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

Initial version of repo, compiles image for amdgpu and nvidia varients.

parent f67c0623
Pipeline #613 failed with stage
in 7 seconds
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:
......@@ -30,7 +8,7 @@ variables:
VERSION: "2.0.0"
before_script:
- docker login -u "${DOCKER_USER}" -p "${DOCKER_TOKEN}"
- echo "${DOCKER_TOKEN}" | docker login --username "${DOCKER_USER}" --password-stdin
stages:
- opencl
......@@ -38,22 +16,31 @@ stages:
.opencl_template: &opencl_definition
stage: opencl
script:
- if [ $CI_COMMIT_REF_NAME == "develop" ]; then
REV = "git";
elif [ $CI_COMMIT_REF_NAME == "master" ]; then
REV = "latest";
else
REV = "$CI_COMMIT_REF_NAME";
fi
- 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}"
--build-arg "aparapiver=${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}"
--build-arg "aparapiver=${VERSION}"
"amdgpu/"
- docker push "${REPOSITORY}-nvidia"
- docker push "${REPOSITORY}-amdgpu"
only
-master
-develop
-tags
only:
- master
- develop
- tags
tags:
- general
opencl:
<<: *opencl_definition
# Aparapi Docker Image Changelog
# 2.0.0-1
* Initial version of the docker images for amdgpu and nvidia.
......@@ -39,3 +39,13 @@ following command.
git clone http://git.qoto.org/aparapi/aparapi-docker.git
```
## Building
```bash
docker build -t <image name> --build-arg "aparapiver=<aparapi Version>" amdgpu/
docker build -t <image name> --build-arg "aparapiver=<aparapi Version>" nvidia/
```
ARG aparapi-ver
FROM maven:3.6.3-openjdk-14
FROM ubuntu:20.04
LABEL maintainer "Jeffrey Phillips Freeman <the@jeffreyfreeman.me>"
ENV AMDGPUDRIVERFILE="amdgpu-pro-17.40-492261.tar.xz"
ENV AMDGPUDIRNAME="amdgpu-pro-17.40-492261"
#ENV AMDGPUDRIVERFILE="amdgpu-pro-17.40-492261.tar.xz"
#ENV AMDGPUDIRNAME="amdgpu-pro-17.40-492261"
ENV AMDGPUDIRNAME="amdgpu-pro-20.20-1098277-ubuntu-20.04"
ENV AMDGPUDRIVERFILE="${AMDGPUDIRNAME}.tar.xz"
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 && \
RUN apt-get update && \
apt-get -y dist-upgrade && \
rm -rf /var/lib/{cache,log}
RUN apt-get update && \
apt-get -y --no-install-recommends install \
maven \
openjdk-14-jre \
openjdk-14-jdk && \
rm -rf /var/lib/{cache,log}
RUN apt-get update && \
apt-get -y --no-install-recommends install \
ca-certificates \
wget \
xz-utils && \
wget --referer https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-20-30 https://drivers.amd.com/drivers/linux/${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}
apt-get install -y opencl-amdgpu-pro && \
apt-get -y autoremove && \
apt-get clean autoclean && \
rm -rf /var/lib/{apt,cache,log}
ARG aparapiver
RUN mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get -DrepoUrl="https://repo1.maven.org/maven2/" -Dartifact=com.aparapi:aparapi:${aparapiver}
#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/
# curl -O https://download.b2go.cloud/AMD-GPU-PRO/$AMDGPUDRIVERFILE && \
# apt-get -y remove ca-certificates wget xz-utils && \
ARG aparapi-ver
FROM maven:3.6.3-openjdk-14
FROM ubuntu:20.04
LABEL maintainer "Jeffrey Phillips Freeman <the@jeffreyfreeman.me>"
RUN apt-get update && \
apt-get -y dist-upgrade && \
rm -rf /var/lib/{cache,log}
RUN apt-get update && \
apt-get -y --no-install-recommends install \
maven \
openjdk-14-jre \
openjdk-14-jdk && \
rm -rf /var/lib/{cache,log}
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/*
apt-get -y autoremove && \
apt-get clean autoclean && \
rm -rf /var/lib/{apt,cache,log}
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}
ARG aparapiver
RUN mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get -DrepoUrl="https://repo1.maven.org/maven2/" -Dartifact="com.aparapi:aparapi:${aparapiver}"
# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES all
......
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