Skip to content

Commit

Permalink
Merge pull request #40 from daimor/master
Browse files Browse the repository at this point in the history
Updated versions, and fixes in the build process
  • Loading branch information
evshvarov authored Nov 17, 2023
2 parents 77b31d3 + a352319 commit c99e23c
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 80 deletions.
43 changes: 25 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ env:
irishealth-community
iris-ml-community
irishealth-ml-community
latest: 2023.2.0.227.0
latest: 2023.3
version: |
2022.1.2.574.0
preview: 2023.3-preview
2023.2
2023.1.1.380.0
preview: latest-preview
jobs:
version:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -82,19 +83,19 @@ jobs:
retry_on: timeout
command: |
docker pull ${{ steps.vars.outputs.basearm }}
- name: docker login
id: login
continue-on-error: true
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: build x86 docker image
id: build
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
retry_on: timeout
retry_on: any
command: |
docker build --build-arg IMAGE=${{ steps.vars.outputs.base }} --build-arg IMAGEARM=${{ steps.vars.outputs.basearm }} ${{ steps.vars.outputs.tags }} --platform linux/amd64 --target x86 .
- name: docker login
id: login
continue-on-error: true
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build --progress plain --no-cache --file Dockerfile-amd64 --build-arg IMAGE=${{ steps.vars.outputs.base }} --build-arg IMAGEARM=${{ steps.vars.outputs.basearm }} ${{ steps.vars.outputs.tags }} --platform linux/amd64 .
- name: push to docker hub
id: push
if: steps.login.outcome == 'success'
Expand All @@ -108,9 +109,10 @@ jobs:
with:
timeout_minutes: 10
max_attempts: 3
retry_on: timeout
retry_on: any
command: |
docker buildx build --load --build-arg IMAGE=${{ steps.vars.outputs.base }} --build-arg IMAGEARM=${{ steps.vars.outputs.basearm }} ${{ steps.vars.outputs.tagsarm }} --platform linux/arm64 --target arm .
docker system prune -f
docker build --progress plain --no-cache --file Dockerfile-arm64 --build-arg IMAGE=${{ steps.vars.outputs.base }} --build-arg IMAGEARM=${{ steps.vars.outputs.basearm }} ${{ steps.vars.outputs.tagsarm }} --platform linux/arm64 .
- name: push arm64 to docker hub
id: pusharm
if: steps.buildarm.outcome == 'success'
Expand All @@ -119,10 +121,15 @@ jobs:
echo $tags | xargs -n1 sh -c 'docker push $0'
- name: update manifest
if: steps.push.outcome == 'success' && steps.pusharm.outcome == 'success'
run: |
tags="${{ steps.vars.outputs.tagsarm }}";tags=${tags// -t / }
echo $tags | xargs -n1 bash -c 'docker manifest rm ${1//-arm64/} || true' - $1
echo $tags | xargs -n1 bash -c 'docker manifest inspect ${1//-arm64/}' - $1
echo $tags | xargs -n1 bash -c 'docker manifest create ${1//-arm64/} ${1//-arm64/} $1 --amend' - $1
echo $tags | xargs -n1 bash -c 'docker manifest push ${1//-arm64/}' - $1
echo $tags | xargs -n1 bash -c 'docker manifest inspect ${1//-arm64/}' - $1
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
retry_on: timeout
command: |
tags="${{ steps.vars.outputs.tagsarm }}";tags=${tags// -t / }
echo $tags | xargs -n1 bash -c 'docker manifest rm ${1//-arm64/} || true' - $1
echo $tags | xargs -n1 bash -c 'docker manifest inspect ${1//-arm64/}' - $1
echo $tags | xargs -n1 bash -c 'docker manifest create ${1//-arm64/} ${1//-arm64/} $1 --amend' - $1
echo $tags | xargs -n1 bash -c 'docker manifest push ${1//-arm64/}' - $1
echo $tags | xargs -n1 bash -c 'docker manifest inspect ${1//-arm64/}' - $1
7 changes: 7 additions & 0 deletions Dockerfile-amd64
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# syntax = edrevo/dockerfile-plus

INCLUDE+ Dockerfile-phase1

FROM --platform=linux/amd64 $IMAGE as x86

INCLUDE+ Dockerfile-phase2
7 changes: 7 additions & 0 deletions Dockerfile-arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# syntax = edrevo/dockerfile-plus

INCLUDE+ Dockerfile-phase1

FROM --platform=linux/arm64 $IMAGEARM as arm

INCLUDE+ Dockerfile-phase2
62 changes: 0 additions & 62 deletions Dockerfile → Dockerfile-phase1
Original file line number Diff line number Diff line change
Expand Up @@ -39,65 +39,3 @@ RUN \
"halt" \
| iris session $ISC_PACKAGE_INSTANCENAME -U %SYS && \
iris stop $ISC_PACKAGE_INSTANCENAME quietly

FROM --platform=linux/amd64 $IMAGE as x86

USER root

WORKDIR /opt/irisapp
RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisapp && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y install git && \
apt-get clean -y && rm -rf /var/lib/apt/lists/* && \
mkdir /docker-entrypoint-initdb.d/

COPY docker-entrypoint.sh /

USER ${ISC_PACKAGE_MGRUSER}

COPY --from=0 --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /usr/irissys/iris.cpf /usr/irissys/iris.cpf
COPY --from=0 --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /usr/irissys/mgr/zpm /usr/irissys/mgr/zpm

ENV PATH="$PATH:/home/irisowner/.local/bin"

COPY --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} iris_ipm.py /usr/irissys/lib/python/

RUN pip install irissqlcli && \
cat /usr/irissys/lib/python/iris_ipm.py >> /usr/irissys/lib/python/iris.py

COPY iriscli /home/irisowner/bin/

ENTRYPOINT [ "/tini", "--", "/docker-entrypoint.sh" ]

CMD [ "iris" ]

FROM --platform=linux/arm64 $IMAGEARM as arm

USER root

WORKDIR /opt/irisapp
RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisapp && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y install git && \
apt-get clean -y && rm -rf /var/lib/apt/lists/* && \
mkdir /docker-entrypoint-initdb.d/

COPY docker-entrypoint.sh /

USER ${ISC_PACKAGE_MGRUSER}

COPY --from=0 --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /usr/irissys/iris.cpf /usr/irissys/iris.cpf
COPY --from=0 --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /usr/irissys/mgr/zpm /usr/irissys/mgr/zpm

ENV PATH="$PATH:/home/irisowner/.local/bin"

COPY --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} iris_ipm.py /usr/irissys/lib/python/

RUN pip install irissqlcli && \
cat /usr/irissys/lib/python/iris_ipm.py >> /usr/irissys/lib/python/iris.py

COPY iriscli /home/irisowner/bin/

ENTRYPOINT [ "/tini", "--", "/docker-entrypoint.sh" ]

CMD [ "iris" ]
28 changes: 28 additions & 0 deletions Dockerfile-phase2
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
USER root

WORKDIR /opt/irisapp
RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisapp && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y install git && \
apt-get clean -y && rm -rf /var/lib/apt/lists/* && \
mkdir /docker-entrypoint-initdb.d/

COPY docker-entrypoint.sh /

USER ${ISC_PACKAGE_MGRUSER}

COPY --from=0 --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /usr/irissys/iris.cpf /usr/irissys/iris.cpf
COPY --from=0 --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /usr/irissys/mgr/zpm /usr/irissys/mgr/zpm

ENV PATH="$PATH:/home/irisowner/.local/bin"

COPY --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} iris_ipm.py /usr/irissys/lib/python/

RUN pip install irissqlcli && \
cat /usr/irissys/lib/python/iris_ipm.py >> /usr/irissys/lib/python/iris.py

COPY iriscli /home/irisowner/bin/

ENTRYPOINT [ "/tini", "--", "/docker-entrypoint.sh" ]

CMD [ "iris" ]

0 comments on commit c99e23c

Please sign in to comment.