• No results found

Reproducible Development Environments!

N/A
N/A
Protected

Academic year: 2021

Share "Reproducible Development Environments!"

Copied!
27
0
0

Loading.... (view fulltext now)

Full text

(1)

Reproducible Development

Environments!

with Docker

+ Visual Studio Code

+ Devcontainers

William Killian

Assistant Professor of Computer Science

(2)

Background /

Disclaimers

Origins

CPOSC theme: Grew up in Lancaster, PA

Education + Interests

BS Computer Science (Millersville)

MS+PhD Computer Science (U of Delaware)

Research

High-Performance and Scientific Computing

Programming Models

CS Education

Disclaimers

All opinions stated in this talk are my own.

Information generously sourced from open-source repositories and documentation. [included at end]

(3)

Outline of Talk

Why do this?

Docker

Building a container

• Dockerfile

syntax

Using a container

Visual Studio Code + Devcontainers

Installing the extension

• devcontainer.json

format + features

(4)

Why?

“Your scientists were so preoccupied

with whether or not they could, they

didn’t stop to think if they should.”

Dr. Ian Malcolm

(5)

Why use Reproducible Environments in

Education (at Millersville University)?

Primarily a response to COVID-19 + Online Modality

Learning remotely, not on campus

• Department computer labs not easily accessible

Internet Stability

• Remote connection to Linux lab not always stable • ~200 students using 27 machines à NOPE.gif

Software + Operating System Variances

• Debugging problems on Windows vs. Linux vs. macOS • Ensure grading + development platforms are consistent

(6)

Goals of Reproducibility

1. Minimize pain points for troubleshooting

• Originally a cross product of OS, software, and languages • Now a single configuration

2. Provide a usable environment for students

• Focus on course learning outcomes • Consistent for everyone

• Mirror / replicate software stack used for grading

(7)

Department Infrastructure

Linux Lab (27 Dell Precision Workstations)

• CPU: Intel Core i7-6700 • RAM: 16GB DDR4

• OS: ArchLinux (a rolling distribution with latest kernel + packages)

Autolab Server (Virtualized Infrastructure)

• Intel Xeon Gold 6230 • RAM: 16GB DDR4 • Host OS: ArchLinux

• Grading Images: any Docker container

Provide the same software stack for

Linux Lab + Autograding + Students

(8)
(9)

What is a Container?

Package of software, its dependencies, and supporting

system software and settings into a single entity

Enables a uniform development experience!

Operating system files

Language toolchains

Libraries and tools

(10)

Defining Our Own Containers

Dockerfile

A recipe for how to build a container

Contains a list of commands

FROM

– define a base container to build from

ENV

– set / modify environment variable

WORKDIR

– change the directory inside of the container

ADD

– copy a file (internet or local) into the container

RUN

– execute a command inside of the container

(11)

Dockerfile

example

FROM archlinux/base

MAINTAINER Will Killian <[email protected]>

ADD autolab /usr/local/bin/

ADD add_user.sh /tmp

RUN /tmp/add_user.sh user password \

RUN sed -i '1s;^;Server = http://mirrors.rutgers.edu/archlinux/$repo/os/$arch\nServer = https://mirrors.rutgers.edu RUN pacman -Syu --noprogressbar --noconfirm \

emacs-nox vim nano base-devel curl wget git unzip rsync openssh mosh man-db

RUN bash -c 'yes | pacman -Scc' USER user

(12)

Building onto a Dockerfile

FROM mucsci/base

MAINTAINER Will Killian <[email protected]>

RUN sudo pacman -Syu --noprogressbar --noconfirm \

gcc clang openmp llvm cmake ninja boost catch2 gtest gmock \ gdb lldb valgrind cppcheck openmpi imagemagick yay

RUN yay -S --needed --noprogressbar --noconfirm lldb-mi

RUN yay -S --noconfirm --nopgpfetch --mflags '--skippgpcheck --nocheck' \ libc++ libc++abi libc++experimental

RUN bash -c "yes | yay -Scc”

(13)

Building onto a Dockerfile

FROM mucsci/base

MAINTAINER Will Killian <[email protected]>

RUN sudo pacman -Syu --noprogressbar --noconfirm \

jdk-openjdk openjdk-src openjdk-doc ant maven gradle junit

RUN bash -c "yes | yay -Scc” ENTRYPOINT /bin/bash -l

(14)

Building onto a Dockerfile

FROM mucsci/base

MAINTAINER Will Killian <[email protected]>

ENV PATH="/home/user/miniconda3/bin:$PATH" ENV MINICONDA_VERSION Miniconda3-py37_4.8.3

RUN wget https://repo.anaconda.com/miniconda/${MINICONDA_VERSION}-Linux-x86_64.sh

RUN bash ${MINICONDA_VERSION}-Linux-x86_64.sh -b

RUN rm -f ${MINICONDA_VERSION}-Linux-x86_64.sh

ENTRYPOINT /bin/bash -l

(15)

MUCS Container Image Hierarchy

archlinux

base

cpp

graphics

python

ai

java

ocaml

Core OS

Base

Software

Languages

Libraries

(16)

Running a Container

Option 1: Command Line

docker pull

mucsci/python

# download

docker run –it mucsci/python

# execute

Drops you into a command line within the container

No access to your “computer” files

(17)
(18)
(19)

Step 2: Load a Devcontainer Project

https://www.github.com/mucsci/devcontainers

Repository has a predefined projects configured for:

• C/C++ (gcc + clang + llvm)

• Java (openjdk 14 + maven + junit + gradle) • OCaml (4.10 + opam)

• JavaScript • Python (3.8)

• .NET (dotnet SDK 3.1) • … and several others

Devcontainers have additional features:

• Automatically install and configure extensions

• Mount directories on your computer in the container • Preserve settings and changes

(20)
(21)

devcontainer.json

Docker Arguments

Additional Environment Variables

VS Code Settings / Configuration Automatic Extension Installation

Automatic Directory Mounting

(22)
(23)
(24)
(25)

Statistics for Fall 2020

Course Language Students

• CSCI 330 (Programming Languages) OCaml ~45 • CSCI 362 (Data Structures) C++ ~45 • CSCI 380 (Operating Systems) C ~25 • CSCI 450 (Artificial Intelligence) Lisp, Python ~25

Autolab (grading platform) additionally used by:

• CSCI 161 (Intro to Programming I) Java ~75 • CSCI 162 (Intro to Programming II) Java ~50 • CSCI 370 (Computer Architecture) Assembly, C ~45

• CSCI 375 (Computer Graphics) C++ ~25

Impacts over

335

(26)

Thank You!

Special thanks to colleagues +

contributors

+ users

Stephanie Schwartz

Chad Hogg

Gary Zoppetti

Chris Cain

Jingnan Xie

Cole Vohs

Ed Schwartz

(27)

References

Related documents

Act 1974 or Article 31(4) of the Health and Safety at Work (Northern Ireland) Order 1978 is to be read as a reference to penalties specified in the final item of Schedule 3A to that

The goal of this project is to achieve comprehensive, coordinated, community-based services for children with special needs and their families, through improved

Android runtime consists of Dalvik virtual machine and core java libraries. Dalvik virtual machine is a type of java virtual machine used for running applications

He has completed Software Engineering, Database Management Systems, Computer Graphics and Big Data Analytics. He has experience in Java, C++, Python, MySQL, Javascript,

Extreme Networks® pluggable optics provide physical layer connectivity for optical-port modular switch IO blades and optical-port stackable switches.. • Provides a range of

Selectman Crowley moved that the Board of Selectmen authorize remote participation in public meetings by members of all Town of Medway public bodies in accordance with the

To turn off the module, first of all, remove the external power supply and then press the button PS1 on the right side of the module for at least 10 seconds.. When you release

There are a number of integrated development environments, languages, frameworks and libraries that can be used to develop the solution proposed in this paper. Table II details the