Skip to content

Conversation

@ObadaS
Copy link
Collaborator

@ObadaS ObadaS commented Nov 14, 2025

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

  • Code review by me
  • Hand tested by me
  • I'm proud of my work
  • Code review by reviewer
  • Hand tested by reviewer
  • CircleCi tests are passing
  • Ready to merge

Copy link
Collaborator

@wlln wlln left a 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

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)
Copy link
Collaborator

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

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)
Copy link
Collaborator

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

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:
Copy link
Collaborator

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

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

Successfully merging this pull request may close these issues.

3 participants