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

Adding a docker image for the toolkit #1071

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

turnmanh
Copy link

@turnmanh turnmanh commented Mar 20, 2024

What does this implement/fix? Explain your changes

In order to ease the usability of the toolkit, a Docker image is provided to the user. It allows to:

  • It allows to quickly set up and deploy the toolkit environment, ensuring consistent dependencies and configurations across different systems.
  • Additionally, the Docker image facilitates seamless integration into existing workflows and environments, promoting efficiency and ease of use.

The image is based on the newest release and a re-built is triggered by a new release of the toolkit. The image is published via ghcr.

Does this close any currently open issues?

Fixes #1056

Any relevant code examples, logs, error output, etc?

todo: add how to use the image.

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask. We're here to
help! This is simply a reminder of what we are going to look for before merging
your code.

  • I have read and understood the contribution
    guidelines
  • I agree with re-licensing my contribution from AGPLv3 to Apache-2.0.
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have reported how long the new tests run and potentially marked them
    with pytest.mark.slow.
  • New and existing unit tests pass locally with my changes
  • I performed linting and formatting as described in the contribution
    guidelines
  • I rebased on main (or there are no conflicts with main)

@turnmanh turnmanh added the enhancement New feature or request label Mar 20, 2024
@turnmanh turnmanh added this to the Hackathon 2024 milestone Mar 20, 2024
@turnmanh turnmanh linked an issue Mar 20, 2024 that may be closed by this pull request
@turnmanh
Copy link
Author

@Ziaeemehr, I've added an mvp on how the image can be automatically built upon new releases. What's left is the actual Dockerfile and a description of the intended usage. Finally, we need an access token.

@Ziaeemehr
Copy link
Contributor

Ziaeemehr commented Mar 21, 2024

container images are available and auto-built w/ GitHub Actions, so you can use w/ Docker

docker run --rm -it ghcr.io/sbi-dev/sbi-toolkit:latest python3 -c 'import sbi; print(sbi.__version__)'

to build and run locally:

$ docker build -t sbi .   
$ docker run -v $(pwd)/examples:/sbi -p 8888:8888 -ti sbi 

$(pwd)/examples is local and /sbi is container working directory.

@janfb
Copy link
Contributor

janfb commented Mar 21, 2024

I have to admit that I am new to using docker. Can you say in simple terms how I would make use of this new feature?
What do I have to do to perform SBI on the docker image, and how is it different from my normal workflow: creating a conda env locally and running pip install sbi.
Thanks :)

@Baschdl
Copy link
Contributor

Baschdl commented Mar 22, 2024

Wouldn't a Open In Colab button with our Getting started notebook do the same without requiring us to maintain a Dockerfile?

@Ziaeemehr
Copy link
Contributor

Ziaeemehr commented Mar 24, 2024

Docker is a platform that enables developers to build, ship, and run applications in containers. Containers are lightweight, standalone, and executable packages that contain everything needed to run an application, including the code, runtime, libraries, and dependencies.

It's kind of making an conda environment but user does not need to be worry about installing packages and dependencies. For me installing Cuda toolkit always be annoying and sometimes with headache, especially when you have parallel package which need different version of cuda.

It can also be used for developement, quick introduction video.
@Baschdl While MyBinder or running in Colab offer similar functionality, they come with limitations on memory and runtime for end users. However, working on a local machine provides convenience with access to data and avoids the limitations of online platforms.

@turnmanh know more about the Github Action and Github Registry. As far as I understand, it build the image and uploads it to a hub as a new version of the package release. Maintenance is likely minimal and it uses the same version you maintain for pip.
For giving permission , it need some tokens in the action file.

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

Successfully merging this pull request may close these issues.

Integration of Docker Image Deployment in sbi Package
4 participants