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 developer container and workflow #1325

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/developer-docker-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build developer image

on:
push:
branches: ["develop"]
pull_request:
branches: ["develop"]

env:
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: llnl/raja/developer

jobs:

build:

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: build docker image
run: docker build --build-arg njobs=2 --file containers/developer/Dockerfile --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest .

- name: push docker image
run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
36 changes: 36 additions & 0 deletions containers/developer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
###############################################################################
# Copyright (c) 2016-22, Lawrence Livermore National Security, LLC
# and RAJA project contributors. See the RAJA/LICENSE file for details.
#
# SPDX-License-Identifier: (BSD-3-Clause)
###############################################################################

FROM ghcr.io/rse-ops/cuda-ubuntu-20.04:cuda-11.1.1 AS nvcc11

ARG USER=rajadev
ENV HOME /home/${USER}

RUN apt-get update && apt-get install -y supervisor

RUN useradd --create-home --shell /bin/bash ${USER}
USER ${USER}

WORKDIR $HOME
RUN git clone --recursive -b develop https://github.com/llnl/raja

WORKDIR $HOME/raja/build
RUN . /opt/spack/share/spack/setup-env.sh && spack load cuda && \
cmake -DCMAKE_CXX_COMPILER=g++ -DENABLE_CUDA=On -DCMAKE_CUDA_STANDARD=14 -DCMAKE_CUDA_ARCHITECTURES=70 -DENABLE_OPENMP=On ..

WORKDIR /opt/archives
RUN curl -L https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-v1.69.1/openvscode-server-v1.69.1-linux-x64.tar.gz > \
/opt/archives/openvscode-server-v1.69.1-linux-x64.tar.gz
RUN tar xzf openvscode-server-v1.69.1-linux-x64.tar.gz && chown -R ${USER}:${USER} openvscode-server-v1.69.1-linux-x64

USER root
ADD supervisord.conf /etc/supervisord.conf
RUN sed -i "s/XXX/${USER}/g" /etc/supervisord.conf

RUN touch /var/log/openvscode-server.log && chown -R ${USER}:${USER} /var/log/openvscode-server.log

CMD ["/usr/bin/supervisord"]
10 changes: 10 additions & 0 deletions containers/developer/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[supervisord]
nodaemon = true
user = XXX
logfile = /tmp/supervisord.log

[program:openvscode-server]
environment=HOME="/home/XXX",USER="XXX"
redirect_stderr = true
stdout_logfile = /var/log/openvscode-server.log
command = /opt/archives/openvscode-server-v1.69.1-linux-x64/bin/openvscode-server --without-connection-token --host 0.0.0.0
12 changes: 12 additions & 0 deletions containers/developer/user-data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

yum update -y
amazon-linux-extras install docker
systemctl start docer
systemctl enable docker

wget https://raw.githubusercontent.com/LLNL/RAJA/task/tut-reorg-aws/exercises/Dockerfile
wget https://raw.githubusercontent.com/LLNL/RAJA/task/tut-reorg-aws/exercises/supervisord.conf

env DOCKER_BUILDKIT=1 docker build . -t raja-aws-tut
docker run --init --gpus all -p 3000:3000 raja-aws-tut