Skip to content

Commit

Permalink
Merge pull request #95 from svalinn/gh-action
Browse files Browse the repository at this point in the history
Modify and Update CI Testing
  • Loading branch information
gonuke authored Apr 26, 2024
2 parents 5cc79a5 + 4482f62 commit c0c1d1a
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 12 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/docker_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build & publish Docker image for ParaStell CI

on:
# allows us to run workflows manually
workflow_dispatch:
push:
paths:
- 'Dockerfile'
- '.github/workflows/docker_publish.yml'

jobs:
build-dependency-img:
runs-on: ubuntu-latest

name: Install Dependencies
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log into GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push ParaStell Docker image
id: build-parastell
uses: docker/build-push-action@v5
with:
cache-from: type=registry,ref=ghcr.io/svalinn/parastell:ci-layer-cache
cache-to: type=registry,ref=ghcr.io/svalinn/parastell:ci-layer-cache,mode=max
file: Dockerfile
push: true
target: parastell-deps
tags: ghcr.io/svalinn/parastell-ci

test-dependency-img:
needs: build-dependency-img
runs-on: ubuntu-latest
container: ghcr.io/svalinn/parastell-ci

name: Test CI Image
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Populate environment and run tests
run: |
. /opt/etc/bashrc
sed -e "s/@SERVER@/${rlmSERVER}/" -e "s/@PASSWORD@/${rlmPASSWD}/" /opt/Coreform-Cubit-2023.11/bin/licenses/rlmcloud.in > /opt/Coreform-Cubit-2023.11/bin/licenses/rlmcloud.lic
export PYTHONPATH=${PYTHONPATH}:`pwd`
cd tests
pytest -v .
env:
rlmSERVER: ${{ secrets.RLMSERVER }}
rlmPASSWD: ${{ secrets.RLMPASSWORD }}
23 changes: 11 additions & 12 deletions dockerfile → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM continuumio/miniconda3
FROM continuumio/miniconda3 as parastell-deps

ENV TZ=America/Chicago
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update -y
RUN apt-get upgrade -y

# install dependencies
# Install dependencies
RUN apt-get install -y libgl1-mesa-glx \
libgl1-mesa-dev \
libglu1-mesa-dev \
Expand All @@ -30,27 +30,26 @@ RUN apt-get install -y libgl1-mesa-glx \
libxcursor1 \
libxinerama1

# download cubit
# Download Coreform Cubit
RUN wget -O /cubit.deb https://f002.backblazeb2.com/file/cubit-downloads/Coreform-Cubit/Releases/Linux/Coreform-Cubit-2023.11%2B43088-Lin64.deb

# install cubit
# Install Cubit
RUN dpkg -i cubit.deb
ENV PYTHONPATH=/opt/Coreform-Cubit-2023.11/bin/
COPY ./rlmcloud.in /opt/Coreform-Cubit-2023.11/bin/licenses/rlmcloud.in

# parastell env
RUN mkdir -p /opt/etc
RUN cp /root/.bashrc /opt/etc/bashrc

# Install Python dependencies in parastell env conda environment
COPY ./environment.yml /environment.yml
RUN conda env create -f environment.yml
RUN echo "source activate parastell_env" >> ~/.bashrc
RUN echo "conda activate parastell_env" >> /opt/etc/bashrc

WORKDIR /opt

# install pystell_uw
# Install PyStell-UW
RUN git clone https://github.com/aaroncbader/pystell_uw.git
ENV PYTHONPATH=$PYTHONPATH:/opt/pystell_uw

# install parastell
RUN git clone https://github.com/svalinn/parastell.git
ENV PYTHONPATH=$PYTHONPATH:/opt/parastell

WORKDIR /

5 changes: 5 additions & 0 deletions rlmcloud.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#
# Ports 5053 and 5132 must be open in your firewall for outgoing connections.
#
CUSTOMER Wisc isv=csimsoft server=@SERVER@ port=5053 password=@PASSWORD@

0 comments on commit c0c1d1a

Please sign in to comment.