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

Add Dockerfile for the project #175

Closed
antimora opened this issue Feb 24, 2023 · 6 comments
Closed

Add Dockerfile for the project #175

antimora opened this issue Feb 24, 2023 · 6 comments
Labels
feature The feature request

Comments

@antimora
Copy link
Collaborator

Feature description

For an easy project setup, we should have Dockerfile with all necessary dependency prerequisites.

Feature motivation

With modern IDEs, such as vscode, it's super easy to open a project in Docker. This saves developer's time to setup Burn on their local machine.

(Optional) Suggest a Solution

Add Dockerfile to the root with all required packages and rust tools. Also look into a possibility for CI to use the same Dockerfile to run the tests (for consistency and efficiency).

@antimora antimora added the housekeeping Housekeeping task label Apr 2, 2023
@9876691
Copy link

9876691 commented Apr 24, 2023

I have some experience setting up projects with a Dockerfile.

I would recommend the following.

Follow the new devcontainer specification

https://containers.dev/ This is designed to be used not just by vscode but from the other IDE's and the command line.

So you'll have a folder structure something like

└── .devcontainer/
    ├── devcontainer.json
    └── Dockerfile <-- you may not need this

The reason you might not need the Dockerfile is that Microsoft already publish rust containers, it's only needed if you need to add extra features.

GPU support

Docker comes with GPU support, in the devcontainer.json you'll need to set

"hostRequirements": {
    "gpu": "optional"
},

If the user has installed docker gpu support. i.e for tch-rs the users will need to install https://github.com/NVIDIA/nvidia-docker.

Once the user has installed nvidia docker they will get access to the GPU from the container.

MacOS support

Bear in mind that MacOS users need a Dockerfile that builds to the arm64 architecture.

Project Setup

With modern IDEs, such as vscode, it's super easy to open a project in Docker. This saves developer's time to setup Burn on their local machine.

A lot of users won't download the burn project from github to start playing around. They'll do cargo add burn

But devcontainers give you the ability to do a very fast project setup by creating a template. https://containers.dev/templates

This is directly accessible from the devcontainers menu in vscode.

So for example, I maintain the rust on nails template here https://github.com/purton-tech/rust-on-nails/tree/main/nails-devcontainer

@antimora
Copy link
Collaborator Author

Thank you, @ianpurton. I did not know about these features. It seems very worth looking into them. We want to make a setup easy and quick for new users.

@antimora
Copy link
Collaborator Author

@bioinformatist has submitted a PR draft however, we are still not clear about ultimate goal of this ticket. So have to nail down the scope and survey the users what they actually want.

@bioinformatist
Copy link
Contributor

@antimora @nathanielsimard Sry that I'm working hard on project of our company these days. I have learned a lot about how docker working with Github Actions. Later I'll come back with better design and code. Let's discuss it later.

@antimora
Copy link
Collaborator Author

antimora commented Sep 8, 2023

There was a request and talk about having a Docker file so that can be executed on Lambda instances without any further configurations.

@antimora antimora added feature The feature request and removed housekeeping Housekeeping task labels Sep 8, 2023
@antimora
Copy link
Collaborator Author

Closing it because we do not have a specific use case. We can reopen with some specific target/use case.

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

No branches or pull requests

3 participants