-
Notifications
You must be signed in to change notification settings - Fork 44
[WIP] Using docker-py and podman-py instead of the current subprocess way of doing things #2065
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
base: develop
Are you sure you want to change the base?
Conversation
wlln
left a comment
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.
Typo in variable name
compute_worker/compute_worker.py
Outdated
| except docker.errors.NotFound as e: | ||
| if os.environ.get("CONTAINER_ENGINE_EXECUTABLE").lower() == 'docker': | ||
| client.start(container=container.get('Id')) | ||
| conatinerLogsDemux = client.attach(container, demux=True, stream=True, logs=True) |
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.
You wrote conatinerLogsDemux instead of containerLogsDemux
compute_worker/compute_worker.py
Outdated
| conatinerLogsDemux = client.attach(container, demux=True, stream=True, logs=True) | ||
| elif os.environ.get("CONTAINER_ENGINE_EXECUTABLE").lower() == 'podman': | ||
| client.containers.start(container) | ||
| conatinerLogsDemux = client.containers.attach(container, stream=True, demux=True) |
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.
You wrote conatinerLogsDemux instead of containerLogsDemux
compute_worker/compute_worker.py
Outdated
| conatinerLogsDemux = client.containers.attach(container, stream=True, demux=True) | ||
| # If we enter the for loop after the container exited, the program will get stuck | ||
| if client.inspect_container(container)['State']['Status'].lower() == 'running': | ||
| for log in conatinerLogsDemux: |
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.
You wrote conatinerLogsDemux instead of containerLogsDemux
…an and docker containers
A brief description of the purpose of the changes contained in this PR.
Changed the code to use the Docker and Podman python packages instead of using the current subprocess way of launching containers for the compute worker.
The main thing left to do is to make the stream from the logs of the container to the codabench instance work
Checklist