Skip to content

Commit

Permalink
simple test
Browse files Browse the repository at this point in the history
  • Loading branch information
cboettig committed Jan 31, 2024
1 parent c7a4f85 commit 9174ee4
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 77 deletions.
65 changes: 9 additions & 56 deletions .github/workflows/cuda-test.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,14 @@
name: test for rocker cuda scripts

name: Docker Image CI
on:
pull_request:
branches:
- master
paths:
- tests/rocker_scripts/cuda_matrix.json
- scripts/cuda*.sh
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

workflow_dispatch: null
push:
paths: ['tests/ml-test.Dockerfile']
jobs:
generate_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: set-matrix
run: |
CONTENT=$(jq 'tostring' -r tests/rocker_scripts/cuda_matrix.json)
echo ::set-output name=matrix::"${CONTENT}"
echo "${CONTENT}"
build:
needs: generate_matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{fromJson(needs.generate_matrix.outputs.matrix)}}
permissions: write-all
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Prepare build
id: prep
run: |
lower_script_name=$(echo ${{ matrix.script_name }} | tr '[:upper:]' '[:lower:]')
test_name="${{ matrix.base_image }}-${{ matrix.tag }}-${lower_script_name}-${{ matrix.script_arg }}"
echo ::set-output name=output_tag::"${test_name/"/"/"-"}"
- name: test build
run: |
docker buildx build . -f tests/rocker_scripts/Dockerfile \
--output=type=docker \
--build-arg base_image=${{ matrix.base_image }} \
--build-arg tag=${{ matrix.tag }} \
--build-arg script_name=${{ matrix.script_name }} \
--build-arg script_arg=${{ matrix.script_arg }} \
--tag ${{ steps.prep.outputs.output_tag }}
- name: inspect image
run: |
make inspect-image/"${{ steps.prep.outputs.output_tag }}"
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: tmp
path: tmp
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build -f tests/ml-test.Dockerfile .

25 changes: 25 additions & 0 deletions tests/ml-test.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM rocker/cuda:4.3.2

LABEL org.opencontainers.image.licenses="GPL-2.0-or-later" \
org.opencontainers.image.source="https://github.com/rocker-org/rocker-versioned2" \
org.opencontainers.image.vendor="Rocker Project" \
org.opencontainers.image.authors="Carl Boettiger <[email protected]>"

ENV S6_VERSION=v2.1.0.2
ENV RSTUDIO_VERSION=2023.12.0+369
ENV DEFAULT_USER=rstudio
ENV PANDOC_VERSION=default
ENV QUARTO_VERSION=default
ENV PATH=${VIRTUAL_ENV}/bin:${PATH}

RUN /rocker_scripts/install_rstudio.sh
RUN /rocker_scripts/install_pandoc.sh
RUN /rocker_scripts/install_quarto.sh
RUN /rocker_scripts/install_tidyverse.sh

#COPY scripts/install_ml-cuda.sh /rocker_scripts/install_ml-cuda.sh
#RUN /rocker_scripts/install_ml-cuda.sh

EXPOSE 8787

CMD ["/init"]
21 changes: 0 additions & 21 deletions tests/rocker_scripts/cuda_matrix.json

This file was deleted.

0 comments on commit 9174ee4

Please sign in to comment.