Commit f67c0623 authored by Jeffrey Phillips Freeman's avatar Jeffrey Phillips Freeman 💥
Browse files

Initial version of dockerfiles and CI for amdgpu and nvidia.

parent cbc1ec21
rev-git:
extends: .build-docker
only:
variables: [ $CI_COMMIT_REF_NAME == "develop" ]
variables:
REV: "git"
rev-latest:
extends: .build-docker
only:
variables: [ $CI_COMMIT_REF_NAME == "master" ]
variables:
REV: "latest"
rev-branch:
extends: .build-docker
only:
variables: [ $CI_COMMIT_REF_NAME =~ /[0-9]*.*/ ]
variables:
REV: "${CI_COMMIT_REF_NAME}"
.build-docker:
image: docker:stable
services:
- docker:stable-dind
variables:
REPOSITORY: "aparapi/aparapi"
VERSION: "2.0.0"
before_script:
- docker login -u "${DOCKER_USER}" -p "${DOCKER_TOKEN}"
stages:
- opencl
.opencl_template: &opencl_definition
stage: opencl
script:
- docker pull "${REPOSITORY}-nvidia:${REV}" || true
- docker build --network=host --pull -t "${REPOSITORY}-nvidia:${REV}"
--cache-from "${REPOSITORY}-nvidia:${REV}"
--build-arg "aparapi-ver=${VERSION}"
"nvidia/"
- docker pull "${REPOSITORY}-amdgpu:${REV}" || true
- docker build --network=host --pull -t "${REPOSITORY}-amdgpu:${REV}"
--cache-from "${REPOSITORY}-amdgpu:${REV}"
--build-arg "aparapi-ver=${VERSION}"
"amdgpu/"
- docker push "${REPOSITORY}-nvidia"
- docker push "${REPOSITORY}-amdgpu"
only
-master
-develop
-tags
opencl:
<<: *opencl_definition
ARG aparapi-ver
FROM maven:3.6.3-openjdk-14
LABEL maintainer "Jeffrey Phillips Freeman <the@jeffreyfreeman.me>"
ENV AMDGPUDRIVERFILE="amdgpu-pro-17.40-492261.tar.xz"
ENV AMDGPUDIRNAME="amdgpu-pro-17.40-492261"
WORKDIR /tmp
RUN dpkg --add-architecture i386 && \
apt-get update && apt-get -y dist-upgrade && \
apt-get -y --no-install-recommends install ca-certificates curl xz-utils
# only used to speedup build
#COPY $AMDGPUDRIVERFILE /tmp/
RUN curl -O https://download.b2go.cloud/AMD-GPU-PRO/$AMDGPUDRIVERFILE && \
tar -xvf $AMDGPUDRIVERFILE && rm $AMDGPUDRIVERFILE && \
./$AMDGPUDIRNAME/amdgpu-pro-install -y --compute && \
rm -rf $AMDGPUDIRNAME && \
apt-get -y remove ca-certificates curl xz-utils && \
apt-get -y autoremove && apt-get clean autoclean && \
rm -rf /var/lib/{apt,dpkg,cache,log}
ARG aparapi-ver
FROM maven:3.6.3-openjdk-14
LABEL maintainer "Jeffrey Phillips Freeman <the@jeffreyfreeman.me>"
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ocl-icd-libopencl1 \
ocl-icd-opencl-dev \
clinfo && \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p /etc/OpenCL/vendors && \
echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
RUN mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get -DrepoUrl="https://repo1.maven.org/maven2/" -Dartifact=com.aparapi:aparapi:${aparapi-ver}
# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment