Giter VIP home page Giter VIP logo

deep-learning-devcontainers's Introduction

Deep Learning Devcontainers

Blog Code style: black

Example devcontainer for Deep Learning projects. This repo contains a Dockerfile/devcontainer.json/requirements.txt combination to build a container for deep learning projects containing a collection of useful packages. You can read more about why I think devcontainers are a great idea and the design decisions I made in the linked blog post.

Do I need to install anything to use these containers?

Yes, you will need to have Docker with the Nvidia container runtime installed. Installation instructions can be found here. Depending on your setup, you might also need to have rootless docker configured. I am also assuming that you have VScode with the remote development extension pack installed to take advantage of the Devcontainers feature.

How can I try out this environment?

Simply run Remote containers: Clone Repository in Container Volume from the VScode command palette to clone the repository in an isolated volume, build the image, and spin up a container. Alternatively, you can clone the repository normally and run Remote containers: Open Folder in Container - I sometimes find the second method to be a bit more reliable.

The above steps will give you a VSCode window attached to the container to use as a development environment. If you want to use docker in a more traditional way, i.e build an image and run it as a traditional executable, you can first build with:

docker build -t deep-learning-devcontainers/production:latest -f .devcontainer/Dockerfile .

Then run with:

docker run --privileged --gpus=all deep-learning-devcontainers/production:latest

This will run the main.py file with all dependencies installed and return the result.

What does this example container do?

This container gives you a Ubuntu 20.04 environment with CUDA 11.3, Python 3.8 and the packages from the requirements.txt file. The main.py file simply includes some code for checking that the deep learning libraries installed can successfully see your GPU.

You will need a GPU + drivers capable of CUDA 11.3 - you can check this by running nvidia-smi and ensuring CUDA Version = 11.3 or greater.

How can I containerise my own projects?

If your project uses python virtual environments with a requirements.txt file, all you will need to do is copy the .devcontainer directory from this project into your own project. You can then make any adjustments you want to the Dockerfile and devcontainer.json. I wrote an accompanying blog post explaining some relevant concepts for this.

deep-learning-devcontainers's People

Contributors

charl-ai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.