-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from RECETOX/add_dockerfile
Updated Dockerfile, build script, added GitHub workflow
- Loading branch information
Showing
4 changed files
with
101 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |