Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy task.py and version.py to /usr/local/bin #4

Open
stark525 opened this issue Jun 3, 2021 · 1 comment
Open

Copy task.py and version.py to /usr/local/bin #4

stark525 opened this issue Jun 3, 2021 · 1 comment
Assignees

Comments

@stark525
Copy link

stark525 commented Jun 3, 2021

In order to nicely run as a batch job in cirrus, the Dockerfile needs to copy both task.py and version.py to /usr/local/bin so it is easily accessible.

COPY [ "task.py", "version.py", "/usr/local/bin" ]

@stark525 stark525 self-assigned this Jun 3, 2021
@stark525
Copy link
Author

stark525 commented Jun 10, 2021

Here are steps to reproduce:

  1. build the current Dockerfile with docker build . -t tasktemplate1
  2. run in interactive mode: docker run -it tasktemplate1 bash1
  3. set AWS_DEFAULT_REGION (required here, is set with batch normally) - AWS_DEFAULT_REGION=us-east-1
  4. try to execute task.py
    You'll see this:
bash-4.2# export AWS_DEFAULT_REGION=us-east-2
bash-4.2# task.py -h
Traceback (most recent call last):
  File "/usr/local/bin/task.py", line 16, in <module>
    from version import __version__
ModuleNotFoundError: No module named 'version'

With this change you will not have this issue:

bash-4.2# export AWS_DEFAULT_REGION=us-east-1
bash-4.2# task.py -h
usage: task.py [-h] {local,cirrus} ...

cirrus task

positional arguments:
  {local,cirrus}
    local         Locally process (development)
    cirrus        Process Cirrus STAC Process Catalog

optional arguments:
  -h, --help      show this help message and exit
bash-4.2#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant