Skip to content

Simplify and optimize Docker image #264

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

Merged
merged 23 commits into from
May 5, 2025
Merged

Simplify and optimize Docker image #264

merged 23 commits into from
May 5, 2025

Conversation

edoardob90
Copy link
Member

  • Create a simpler Docker image starting from official Jupyter Docker Stacks
  • Remove jupyter-repo2docker dependency
  • Add GitHub workflow to build & push the image (as before)
  • Adjust the Conda environment which is configured from docker/environment.yml

The old workflow has been renamed to .github/workflows/repo2docker.yml and Binder is still supported via the binder/ directory (unchanged).

Also: since Docker provides already the isolation, there's no need to have another virtual environment. All the tutorial dependencies are installed in the base environment, which is automatically configured by the base image.

@edoardob90 edoardob90 requested a review from baffelli November 20, 2024 14:39
@yakutovicha
Copy link
Member

@edoardob90 do you need a review on this? I could give a hand.

@edoardob90
Copy link
Member Author

@edoardob90 do you need a review on this? I could give a hand.

If you want, you can try to build the container from the Dockerfile. I tested the workflow in the main branch of my fork, and everything seems to work fine. But a double-check is always appreciated 😉

@yakutovicha yakutovicha self-requested a review November 25, 2024 15:56
Copy link
Member

@yakutovicha yakutovicha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @edoardob90, I did a first pass and I would need some clarifications from your side.

@edoardob90 edoardob90 marked this pull request as draft November 27, 2024 17:32
@edoardob90
Copy link
Member Author

edoardob90 commented Nov 30, 2024

Options:

Leave the COPY command

  • We will have two copies of the material when using Codespaces: one in /home/jovyan/python-tutorial and another in /workspaces/python-tutorial (clone by default by GitHub)
  • Docker image is larger and takes slightly longer to build

Remove COPY

  • Users must clone the repository to have the materials available inside the container. On Windows, this means downloading and installing git first (here)
  • Change the README accordingly: the bind-mount directory is not /home/jovyan/work but /home/jovyan/python-tutorial

@edoardob90
Copy link
Member Author

@yakutovicha I think we need to resume/finalize this. It would simplify a lot the build step of the image, and solve the recent problem with the workflow run that, all of a sudden, ran out of disk space on the hosted runner.

If we're deploying only on Renkulab, the COPY instruction to have the repository available inside the container is not needed. Renku already clones the repository and mounts it inside the container at runtime.

@edoardob90 edoardob90 marked this pull request as ready for review May 5, 2025 09:58
edoardob90 added 3 commits May 5, 2025 15:27
* Trigger build for PR, but only when from the same repo
* Multi-arch build
* Uses "docker/metadata" action to set up labels and tags
* Keep only branch, pr, and SHA
* Add repo tags vX.Y or vX.Y.Z
Copy link
Member

@yakutovicha yakutovicha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, grazie @edoardob90!

@yakutovicha yakutovicha merged commit b6e3338 into main May 5, 2025
3 checks passed
@yakutovicha yakutovicha deleted the add-dockerfile branch May 5, 2025 15:05
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.

2 participants