Skip to content

Commit

Permalink
Dockerfile (#27)
Browse files Browse the repository at this point in the history
* Dockerfileの修正

* Update docker-image.yml

* Update docker-image-minimum.yaml
  • Loading branch information
29rou authored Mar 26, 2024
1 parent afb3c1b commit 149ea4d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 115 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/docker-image-minimum.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ jobs:
type=schedule,pattern={{date 'YYYYMMDD'}},enable=true,priority=1000
type=raw,pattern={{version}},value={{date 'YYYYMMDD-HHmmss'}}
type=sha
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Env
run: |
env|sort
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
Expand Down Expand Up @@ -98,11 +93,6 @@ jobs:
type=schedule,pattern={{date 'YYYYMMDD'}},enable=true,priority=1000
type=raw,pattern={{version}},value={{date 'YYYYMMDD-HHmmss'}}
type=sha
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Env
run: |
env|sort
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -127,7 +117,7 @@ jobs:
push: true
pull: true
sbom: true
outputs: type=image,push=true,compression=uncompressed
outputs: type=image,push=true,compression=estargz
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
Expand Down
20 changes: 7 additions & 13 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ jobs:
type=schedule,pattern={{date 'YYYYMMDD'}},enable=true,priority=1000
type=raw,pattern={{version}},value={{date 'YYYYMMDD-HHmmss'}}
type=sha
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Env
run: |
env|sort
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -67,11 +62,13 @@ jobs:
with:
context: .
push: true
outputs: type=image,push=true,compression=gzip
outputs: type=image,push=true,compression=estargz
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
target: openjij-builder
cache-from: type=gha
cache-to: type=gha,mode=max

build-and-push-image-old:
runs-on: ubuntu-latest
Expand All @@ -97,11 +94,6 @@ jobs:
type=schedule,pattern={{date 'YYYYMMDD'}},enable=true,priority=1000
type=raw,pattern={{version}},value={{date 'YYYYMMDD-HHmmss'}}
type=sha
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Env
run: |
env|sort
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -127,9 +119,11 @@ jobs:
with:
context: .
push: true
outputs: type=image,push=true,compression=gzip
outputs: type=image,push=true,compression=estargz
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
target: openjij-builder-old
target: openjij-builder-old
cache-from: type=gha
cache-to: type=gha,mode=max

120 changes: 29 additions & 91 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,127 +1,65 @@
FROM --platform=linux/x86_64 quay.io/pypa/manylinux_2_28_x86_64:latest AS manylinux_2_28

FROM manylinux_2_28 AS intel-one-api-install

COPY config.txt /tmp/config.txt
RUN \
--mount=type=bind,target=/etc/yum.repos.d/oneAPI.repo,source=oneAPI.repo \
--mount=type=cache,target=/var/cache/dnf \
--mount=type=cache,target=/var/lib/dnf \
dnf -y repository-packages "oneAPI" list --available

RUN \
--mount=type=bind,target=/etc/yum.repos.d/oneAPI.repo,source=oneAPI.repo \
--mount=type=cache,target=/var/cache/dnf \
--mount=type=cache,target=/var/lib/dnf \
dnf -y install intel-basekit intel-hpckit && \
--mount=type=tmpfs,target=/var/cache/dnf \
--mount=type=tmpfs,target=/var/lib/dnf \
dnf config-manager --set-enabled powertools && \
dnf -y --enablerepo=powertools install eigen3-devel && \
dnf -y clean all

FROM intel-one-api-install AS intel-one-api-configure

ONBUILD COPY config.txt /tmp/config.txt

FROM intel-one-api-configure AS config-txt

RUN export

FROM config-txt AS eigen3-devel
#全部入り

FROM manylinux_2_28 AS openjij-builder
RUN \
--mount=type=cache,target=/var/cache/dnf \
--mount=type=cache,target=/var/lib/dnf \
dnf config-manager --set-enabled powertools && \
dnf -y --enablerepo=powertools install eigen3-devel && \
--mount=type=bind,target=/etc/yum.repos.d/oneAPI.repo,source=oneAPI.repo \
--mount=type=tmpfs,target=/var/cache/dnf \
--mount=type=tmpfs,target=/var/lib/dnf \
dnf -y repository-packages "oneAPI" list --available && \
dnf -y install intel-basekit intel-hpckit && \
dnf -y clean all

FROM eigen3-devel AS openjij-builder

#軽量バージョン

FROM manylinux_2_28 AS intel-one-api-install-minimum

FROM manylinux_2_28 AS openjij-builder-minimum
RUN \
--mount=type=bind,target=/etc/yum.repos.d/oneAPI.repo,source=oneAPI.repo \
--mount=type=cache,target=/var/cache/dnf \
--mount=type=cache,target=/var/lib/dnf \
--mount=type=tmpfs,target=/var/cache/dnf \
--mount=type=tmpfs,target=/var/lib/dnf \
dnf -y install \
intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic \
intel-oneapi-compiler-fortran \
intel-oneapi-mkl \
intel-oneapi-mkl-devel \
intel-oneapi-openmp && \
dnf -y clean all

# intel-oneapi-python

FROM intel-one-api-install-minimum AS intel-one-api-configure-minimum

ONBUILD COPY config.txt /tmp/config.txt

FROM intel-one-api-configure-minimum AS config-txt-minimum

FROM config-txt-minimum AS eigen3-devel-minimum

RUN \
--mount=type=cache,target=/var/cache/dnf \
--mount=type=cache,target=/var/lib/dnf \
dnf config-manager --set-enabled powertools && \
dnf -y --enablerepo=powertools install eigen3-devel && \
dnf -y clean all

FROM eigen3-devel-minimum AS openjij-builder-minimum

#古いバージョン
FROM --platform=linux/x86_64 quay.io/pypa/manylinux2014_x86_64:latest AS manylinux2014

FROM manylinux2014 AS intel-one-api-install-old
COPY config.txt /tmp/config.txt
RUN \
--mount=type=bind,target=/etc/yum.repos.d/oneAPI.repo,source=oneAPI.repo \
--mount=type=cache,target=/var/cache/yum \
--mount=type=cache,target=/var/lib/yum \
yum -y install intel-basekit intel-hpckit

FROM intel-one-api-install-old AS intel-one-api-configure-old

ONBUILD COPY config.txt /tmp/config.txt

FROM intel-one-api-configure-old AS config-txt-old

RUN export
--mount=type=tmpfs,target=/var/cache/yum \
--mount=type=tmpfs,target=/var/lib/yum \
yum -y install eigen3-devel

FROM config-txt-old AS eigen3-devel-old
#全部入り

FROM manylinux2014 AS openjij-builder-old
RUN \
--mount=type=cache,target=/var/cache/yum \
--mount=type=cache,target=/var/lib/yum \
yum -y install eigen3-devel

FROM eigen3-devel-old AS openjij-builder-old
--mount=type=bind,target=/etc/yum.repos.d/oneAPI.repo,source=oneAPI.repo \
--mount=type=tmpfs,target=/var/cache/yum \
--mount=type=tmpfs,target=/var/lib/yum \
yum -y install intel-basekit intel-hpckit

#軽量バージョン
FROM manylinux2014 AS intel-one-api-install-old-minimum

FROM manylinux2014 AS openjij-builder-old-minimum
RUN \
--mount=type=bind,target=/etc/yum.repos.d/oneAPI.repo,source=oneAPI.repo \
--mount=type=cache,target=/var/cache/yum \
--mount=type=cache,target=/var/lib/yum \
--mount=type=tmpfs,target=/var/cache/yum \
--mount=type=tmpfs,target=/var/lib/yum \
yum -y install \
intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic \
intel-oneapi-compiler-fortran \
intel-oneapi-mkl \
intel-oneapi-mkl-devel \
intel-oneapi-openmp

FROM intel-one-api-install-old-minimum AS intel-one-api-configure-old-minimum

ONBUILD COPY config.txt /tmp/config.txt

FROM intel-one-api-configure-old-minimum AS config-txt-old-minimum

RUN export

FROM config-txt-old-minimum AS eigen3-devel-old-minimum

RUN \
--mount=type=cache,target=/var/cache/yum \
--mount=type=cache,target=/var/lib/yum \
yum -y install eigen3-devel

FROM eigen3-devel-old-minimum AS openjij-builder-old-minimum

0 comments on commit 149ea4d

Please sign in to comment.