Skip to content

Commit

Permalink
Merge pull request svalinn#105 from svalinn/oo_version
Browse files Browse the repository at this point in the history
Object-oriented upgrade
  • Loading branch information
gonuke authored May 17, 2024
2 parents 8cad579 + 623f4e9 commit 3a755b6
Show file tree
Hide file tree
Showing 38 changed files with 9,407 additions and 2,381 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Regular CI testing for parastell

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

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

name: Perform CI Tests
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 }}
61 changes: 61 additions & 0 deletions .github/workflows/docker_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
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'
- 'environment.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 }}
31 changes: 20 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@

# PRoject specific
*.csv
*.step
*.h5m
*.txt
*.nc
*.jou
*.ods
*.vtk
*.cub
*.cub5
*.h5
*.exo
!wout_vmec.nc
.vscode
*.yaml
!config.yaml
*.lic

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -128,14 +148,3 @@ dmypy.json
# Pyre type checker
.pyre/

*.csv
*.step
*.h5m
*.txt
*.nc
*.jou
*.ods
*.vtk
*.cub
*.cub5
*.h5
55 changes: 55 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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
RUN apt-get install -y libgl1-mesa-glx \
libgl1-mesa-dev \
libglu1-mesa-dev \
freeglut3-dev \
libosmesa6 \
libosmesa6-dev \
libgles2-mesa-dev \
curl \
wget \
libx11-6 \
libxt6 \
libgl1 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-render-util0 \
libxkbcommon-x11-0 \
libxcb-randr0 \
libxcb-xinerama0 \
libxm4 \
libtiff5 \
libxcursor1 \
libxinerama1

# 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
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

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 "conda activate parastell_env" >> /opt/etc/bashrc

WORKDIR /opt

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

WORKDIR /
115 changes: 0 additions & 115 deletions ExampleScript.py

This file was deleted.

Loading

0 comments on commit 3a755b6

Please sign in to comment.