Coder Social home page Coder Social logo

fjandrad / development-env Goto Github PK

View Code? Open in Web Editor NEW

This project forked from diegoferigo/development-iit

0.0 0.0 0.0 382 KB

Docker-based isolated development environment for my activities

Home Page: https://github.com/diegoferigo/devenv

Shell 36.50% JavaScript 3.97% Dockerfile 56.81% Makefile 2.72%

development-env's Introduction

development environments

WhatBuildDownloadUseNotes

Build Status (master)

What

This repository stores my personal development environment for the activities at the Italian Institute of Technology.

These images are based upon the diegoferigo/devenv tool, which provides a bunch of nice features such as runtime user creation, X11 forwarding support, nvidia-docker, etc.

This repository stores three docker-based isolated development environments, progressively built upon each other:

  • Tools provides a generic toolset for C++ development and it is a good candidate to be the base of other images. It mainly contains QtCreator, updated version of cmake, gcc and clang, and other various debugging tools such as gdb, valgrind, rr, iwyu, etc.
  • Development contains the YARP and ROS robotic middlewares and Gazebo, and all the projects that depend on them.
  • ReinforcementLearning is still in an early stage of development, and it contains all the resources I need for my research project. At the time of writing it has mainly the ignition robotics libraries, Julia, Jupyter notebook, few python packages.

In all these images there are included many utilities, scripts, and customization I developed over time.

Build the images

All the images can be built using the provided Makefile. Just type:

make <target>
Targets
tools
development-latest
development-master
rl-latest
rl-master

All the images are based on top of diegoferigo/devenv:nvidia which optionally support the nvidia runtime if specified in the config file.

Download the images

Alternatively to building the images, you can download the pre-built versions which are stored in my dockerhub profile. This repository has a CI pipeline that periodically builds all the images. Though, not all tags are pushed to dockerhub.

Use the images

In the conf folder you can find the devenv config files of the provided images. Edit them for your needs and then, from that folder, just execute:

devenv -f <image>.yml up

Finally, access the image using docker exec -it <image> su $(whoami).

Notes

Bumblebee support

The nvidia version of the images, thanks to nvidia-docker, supports natively systems based on Nvidia prime. A system properly configured for using bumblebee (or just bbswitch) can start a container able to access the Nvidia gpu only by prepending optirun to the devenv / docker run / docker-compose command.

Be aware that if you start in this way detached containers (-d) the optirun process dies right after, turning off the GPU, while the container stays active in the background with missing hardware resources.

development-env's People

Contributors

diegoferigo avatar fjandrad avatar

development-env's Issues

Main dev environment software

List of base tools and software I would like to have in the environment:

Tools

  • newest qt
  • typora
  • mendely
  • terminator
  • teams

Robotics

main

  • ROS
  • gazebo

selected features

  • pal's docker
  • robotology-superbuild
  • julia

particular setups (persistent or volume required)

  • matlab

Allow docker image to use matlab

Given the size of matlab installation it does not make sense to have it in images since it will increase its size alot + there might be some licensing issues.
devenv is able to handle it through persistent volumes

The required steps ARE:

  • Include the Ethernet interfaces name or WiFi interface name if there is no Etherenet interface in the mac variable of the conf file for the image. Can be obtained with iwconfig or ipconfig command. Example in

  • Put the path to the folder in which matlab was installed

The rest of the information can be kept as is from the setup found in https://github.com/fjandrad/development-env/blob/8a9efd5979ddf8f390fcc015f113d406fa4734ee/conf/development.yml

Create my own target for command make the docker build

Current targets are found in Makefile.
To start understanding the nuances we will attempt to create a tools_plus target to be built on top of tools. This might allows to further customize and build our own environment.

Steps to follow

add entry to Makefile

# =====
# TOOLS-Plus
# =====

tools-plus:
	docker build --rm \
	--build-arg from=fjandrad/tools \
	--tag fjandrad/tools_plus \
	Tools_plus/

Notice that we added our own docker username both for the new tools-plus and the old tools image. So we need to modify also the TOOLS entry and make the new image. Do something similar for the push.

Create a folder to host the Dockerfile

( in this case TOOLS_PLUS)
so mkdir TOOLS_PLUS
create and edit a Dockerfile in this case we will use one with the modifications mentioned here

create conf file

In this case we can copy directly the tools conf and modify the name of the image

.
.
.
tools:
    image: "fjandrad/tools_plus"
    container_name: "tools-plus"
.
.
.
devenv:
  version: '1.0'
  tools-plus:
.
.
.

Store docker images and volumes on home instead of root

On a typical linux installation root partition is not so big ~20gb. The images for the full development environment are over 5gb therefore we would be saturating root prettty quick.

To store docker images, containers and volumes in home we do the following steps:

  1. Stop the daemon service stop docker
  2. Edit the etc/docker/daemon.json by adding "data-root": "/home/$user/$docker-folder-name",
  3. Note the , is used in case there are other commands in the daemon.json file.
  4. Restart the daemon service start docker

Details and documentation on the solution can be found in https://docs.docker.com/config/daemon/systemd/

Problems with current installation of devenv on top of a working docker configuration

Since devenv installs docker and docker-compose, sometimes there is a conflict in the installation when a previous docker has been installed and is working.

The solution found here

Suggest doing the following:

pip3 uninstall docker-py
pip3 uninstall docker-compose
pip3 install --upgrade --force-reinstall --no-cache-dir docker-compose

This allowed to get devenv working.

Unable to use gpu acceleration due to docker-compose lack of support for --gpu options

When using docker 19.03 or above nvidia-docker2 is deprecated.

The devenv environment provides gpu support through the nvidia-container-runtime and the runtime docker-compose command. This implies using a docker version < 19.03 and nvidia-docker2 to keep having gpu support in the images.

The issue seems to be in progress in docker-compose

Link for installing nvidia-docker2

A possible work around is to manually install the nvidia runtime

Found in nvidia-docker wiki

Do you support Docker Compose?

Yes, use Compose format 2.3 and add runtime: nvidia to your GPU service. Docker Compose must be version 1.19.0 or higher. You can find an example here.

 Note that you'll have to install the old nvidia-docker2 packages.

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.