Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Development containers for ML Research

machinelearning-one/devel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

machinelearning-one/devel

A clean template to kick-start your deep learning research 🚀⚡🔥

Suggestions are always welcome!

What's included in the image?

What's included in this repo?

  • An example .env file to parametrize the build process
  • A modular and easily customizable Dockerfile that defines the installation of above mentioned packages
  • A docker-compose.yml file to handle lifecycle events such as building the image, spinning up the container and tearing it down.
  • A .vscode/extensions.json file to recommend the necessary extensions to effectively use generated containers through vs code.

Prerequisites

Download and install:

Getting Started

  1. Clone the repository:
git clone https://github.com/machinelearning-one/devel.git
  1. Open directory in VS Code and accept installing recommended extensions if prompted:
cd devel
code .
  1. Set up environment variables and rename the example file:
mv .env.example .env
  1. Create a shared directory to be mapped into the container:
export SHARED_DIR=<SHARED_DIR>
mkdir -p $SHARED_DIR
  1. Enable Buildkit for faster and cacheable builds:
export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1
  1. Set the password and start the build:
docker compose build --build-arg PASSWORD=<PASSWORD>
  1. Instantiate the container:
docker compose up -d
  1. Start developing!

Navigate to Remote Explorer tab on the sidebar and click on attach to the container to have a holistic development experience.

Notes

SSH Key Generation:

To push code to remote repositories, it is recommended to use ssh over https. To generate a key pair, run the following command:

ssh-keygen -t ed25519 -C "<comment>"

It is recommended you set up a passphrase different from user password.

If you accept the default prompt for the location, public key can be found at ~/.ssh/id_ed25519.pub, otherwise it would be at the location you specified.

Copy the public key and follow the instructions of your VCS provider (GitHub/GitLab etc.) to assign it as trusted.

Recursive Containerization

You might need to use containers from your development environment for reasons such as (1) Developing containers, (2) Avoiding installation of heavy dependencies etc.

The recommended approach to do so is Docker out of Docker specified here

To use recursive containerization, run the following commands first and then follow the same steps as above to build and start the container:

  1. To switch to appropriate branch:
git checkout variant/recursive
  1. To avoid using sudo to access docker daemon from the container
export DOCKER_GROUP=`stat -c '%g' /var/run/docker.sock`

The variant/recursive branch provides logic for mounting the docker socket and the python sdk. A full cli inside the container is out of scope of this template and isn't recommended.

Cleanup

To remove the container, run the following command from the same folder:

docker compose down

License

This project is licensed under the MIT License.

MIT License

Copyright (c) 2022 machinelearning-one

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

About

Development containers for ML Research

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published