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

Updated Dockerfile, build script, added GitHub workflow #4

Merged
merged 1 commit into from
Feb 15, 2024
Merged
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
18 changes: 18 additions & 0 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Docker Image Build CI

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

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag recetox/qcxms-docker:main
26 changes: 26 additions & 0 deletions .github/workflows/push-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: push Docker image

on:
release:
types: [published]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_API_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: recetox/qcxms-docker:${{ github.event.release.tag_name }}
22 changes: 16 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
FROM ubuntu:20.04
RUN sudo apt-get install git
RUN git clone https://github.com/qcxms/qcxms
RUN git checkout ...
COPY build.sh .
RUN bash build.sh
...

# Update package lists
RUN apt-get update -y

# Install wget and xz-utils
RUN apt-get install -y wget xz-utils python3

# Create directories for extraction
RUN mkdir /qcxms_bin
RUN mkdir /plotms_bin

# Download and extract QCxMS and PlotMS
RUN wget https://github.com/qcxms/QCxMS/releases/download/v.5.2.1/QCxMS.v.5.2.1.tar.xz && tar -xvf QCxMS.v.5.2.1.tar.xz -C /qcxms_bin
RUN wget https://github.com/qcxms/PlotMS/releases/download/v.6.2.0/PlotMS.v.6.2.0.tar.xz && tar -xvf PlotMS.v.6.2.0.tar.xz -C /plotms_bin

RUN chmod +x /qcxms_bin/getres
41 changes: 41 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash

add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get update
apt-get install -y gcc-9 gfortran-9

update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-9 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-9 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-9


mkdir -p /opt/intel
chown $USER:$USER /opt/intel

wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB

apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB

echo "deb https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list

apt-get update
apt-get install -y intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-mkl intel-oneapi-mkl-devel

source /opt/intel/oneapi/setvars.sh
source /opt/intel/oneapi/compiler/2024.0/env/vars.sh

pip install meson==0.58.0 ninja

set -ex
export FC=ifort CC=icc

meson setup _build \
${MESON_ARGS:---prefix=$PWD/qcxms_bin --libdir=lib} \
--buildtype=release \
-Dfortran_link_args=-qopenmp

meson compile -C _build

meson install -C _build --no-rebuild
Loading