-
Notifications
You must be signed in to change notification settings - Fork 1
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 #126 from f-kretschmer/docker
Move to docker
- Loading branch information
Showing
72 changed files
with
951 additions
and
2,860 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 |
---|---|---|
@@ -1 +1,5 @@ | ||
options(renv.config.ppm.enabled = TRUE) | ||
options(renv.config.ppm.default = TRUE) | ||
options(repos = c(CRAN = "https://packagemanager.posit.co/cran/__linux__/bookworm/2024-02-06")) | ||
options(renv.config.repos.override = getOption("repos")) | ||
source("renv/activate.R") |
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,27 @@ | ||
name: Build and push docker container | ||
|
||
on: | ||
push: | ||
paths: | ||
# - 'scripts/**' # whole scripts probably too much | ||
- 'scripts/Python/requirements.txt' | ||
- 'renv.lock' | ||
- 'renv/**' | ||
- 'Dockerfile' | ||
- '.Rprofile' | ||
|
||
jobs: | ||
dockerloginbuildpush: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/checkout@v3 | ||
- name: Create image from repository | ||
run: docker build -t ghcr.io/${{ github.actor }}/repo_rt_preprocessing . | ||
- name: Push image to GitHub Container Registry | ||
run: docker push ghcr.io/${{ github.actor }}/repo_rt_preprocessing:latest |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -11,10 +11,14 @@ on: | |
jobs: | ||
preprocess: | ||
name: Preprocess raw data | ||
# NOTE: on windows as computing of descriptors has a bug on linux right now | ||
runs-on: windows-2019 | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} # needed for pulling R packages from github | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/${{ github.actor }}/repo_rt_preprocessing:latest | ||
env: | ||
RENV_PATHS_LIBRARY: '/renv/library' | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
steps: | ||
- name: Checkout fork repository | ||
|
@@ -33,49 +37,14 @@ jobs: | |
- name: Get new/changed datasets | ||
id: filesfolders | ||
shell: bash {0} | ||
run: echo "files=$(for f in ${{ steps.files.outputs.all }}; do basename $(dirname $f); done | grep -E '^[0-9]+$' | sort | uniq | tr '\n' ' ')" >> $GITHUB_OUTPUT | ||
run: echo "files=$(for f in ${{ steps.files.outputs.added_modified_renamed }}; do basename $(dirname $f); done | grep -E '^[0-9]+$' | sort | uniq | tr '\n' ' ')" >> $GITHUB_OUTPUT | ||
|
||
- name: List all added files | ||
shell: bash {0} | ||
run: | | ||
for f in ${{ steps.filesfolders.outputs.files }}; do | ||
ls -lh raw_data/$f | ||
done | ||
- name: Pyton dependencies | ||
run: pip install -r scripts/Python/requirements.txt | ||
|
||
- name: Setup java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Set RENV_PATHS_ROOT | ||
shell: bash | ||
run: | | ||
echo "RENV_PATHS_ROOT=${{ runner.temp }}/renv" >> $GITHUB_ENV | ||
- name: Setup R | ||
uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
r-version: 4.2.2 | ||
|
||
- name: Restore Renv package cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.RENV_PATHS_ROOT }} | ||
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-renv- | ||
- name: Activate renv | ||
shell: Rscript {0} | ||
run: | | ||
options(renv.config.mran.enabled = FALSE) | ||
renv::restore() | ||
- name: Standardize compounds | ||
run: Rscript scripts/R_ci/compounds_standardize.R ${{ steps.filesfolders.outputs.files }} | ||
|
||
|
@@ -117,6 +86,7 @@ jobs: | |
run: | | ||
git config --global user.email '[email protected]' | ||
git config --global user.name 'Github Actions' | ||
git config --global safe.directory '*' | ||
# Use LFS storage of main repository: no push access to fork LFS storage | ||
# TODO: change once repository is moved | ||
git config lfs.url 'https://github.com/f-kretschmer/pr_test_repo.git/info/lfs' | ||
|
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 |
---|---|---|
|
@@ -35,66 +35,31 @@ on: | |
jobs: | ||
preprocess: | ||
name: Preprocess raw data | ||
# NOTE: on windows as computing of descriptors has a bug on linux right now | ||
runs-on: windows-2019 | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} # needed for pulling R packages from github | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/${{ github.actor }}/repo_rt_preprocessing:latest | ||
env: | ||
RENV_PATHS_LIBRARY: '/renv/library' | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
lfs: true | ||
|
||
|
||
- name: List all files for selected datasets | ||
shell: bash {0} | ||
run: | | ||
for f in ${{ inputs.datasets }}; do | ||
ls -lh raw_data/$f || true | ||
ls -lh processed_data/$f || true | ||
done | ||
continue-on-error: true | ||
|
||
- name: Pyton dependencies | ||
run: pip install -r scripts/Python/requirements.txt | ||
# needed for every task | ||
|
||
- name: Setup java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
# needed for every task | ||
|
||
- name: Set RENV_PATHS_ROOT | ||
shell: bash | ||
run: | | ||
echo "RENV_PATHS_ROOT=${{ runner.temp }}/renv" >> $GITHUB_ENV | ||
# needed for every task | ||
|
||
- name: Setup R | ||
uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
r-version: 4.2.2 | ||
# needed for every task | ||
|
||
- name: Restore Renv package cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.RENV_PATHS_ROOT }} | ||
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-renv- | ||
# needed for every task | ||
|
||
- name: Activate renv | ||
shell: Rscript {0} | ||
run: | | ||
options(renv.config.mran.enabled = FALSE) | ||
renv::restore() | ||
# needed for every task | ||
- name: check renv | ||
run: Rscript -e "renv::status()" | ||
|
||
- name: Standardize compounds | ||
run: Rscript scripts/R_ci/compounds_standardize.R ${{ inputs.datasets }} | ||
|
@@ -145,8 +110,8 @@ jobs: | |
run: | | ||
git config --global user.email '[email protected]' | ||
git config --global user.name 'Github Actions' | ||
# Use LFS storage of main repository: no push access to fork LFS storage | ||
# TODO: change once repository is moved | ||
# because of dockerized environment, git will otherwise complain about "dubious ownership of directory" | ||
git config --global safe.directory '*' | ||
git add processed_data raw_data | ||
git commit -m "Preprocessing ${{ inputs.datasets }}" -m "Tasks: | ||
- standardize compounds: ${{ inputs.do_standardize }} | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.