-
Notifications
You must be signed in to change notification settings - Fork 37
Adding container image for running examples #209
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two minor comments, otherwise I ran things and everything worked as specified! Once you have addressed those, this is good to merge. Thanks!
Docker build takes around `6m16.298s` depending on the system configuration and network. | ||
Alternatively, you can pull the container image from here: ... | ||
|
||
3. Creating a container |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3. Creating a container | |
3. Starting your docker container |
```bash | ||
cd hamilton/examples/hello_world | ||
source hamilton-env/bin/activate | ||
python my_script.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python my_script.py | |
python my_script.py | |
deactivate # this will deactivate the python virtual environment, allow you to activate other ones for the other examples. |
4. Running the `hello_world` example inside the container | ||
```bash | ||
cd hamilton/examples/hello_world | ||
source hamilton-env/bin/activate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
source hamilton-env/bin/activate | |
source hamilton-env/bin/activate # this will activate the virtual environment |
cd hamilton/examples/hello_world | ||
source hamilton-env/bin/activate | ||
python my_script.py | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add something like:
You should be able to run all the examples that have only a requirements.txt
. If there are other requirements.txt files (like under data_quality), you'll just need to manually create an environment and install those requirements yourself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @skrawcz it was fun to work on this issue. I'll keep looking on open issues to see if I could contribute on something else. |
Added dockerfile for testing examples in a container environment.
Changes
hamilton
that should be activated first before running the example.Testing
docker build --tag hamilton-example .
hello_world
example inside the containerNotes
Checklist
Testing checklist
Python - local testing