Browse Source

Merge branch 'candidate-8.6.8' into candidate-8.6.x

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 3 years ago
parent
commit
c7a41889dc

+ 6 - 4
.github/workflows/build-and-publish.yml

@@ -55,10 +55,12 @@ jobs:
     - name: Build
       uses: ./dockerfiles
       with:
-        username: ${{ secrets.JFROG_USERNAME }}
-        password: ${{ secrets.JFROG_PASSWORD }}
-        registry: ${{ secrets.JFROG_REGISTRY }}
-        docker_repo: ${{ secrets.JFROG_REPOSITORY }}
+        username: ${{ secrets.DOCKER_USERNAME }}
+        password: ${{ secrets.DOCKER_PASSWORD }}
+        ln_username: ${{ secrets.JFROG_USERNAME }}
+        ln_password: ${{ secrets.JFROG_PASSWORD }}
+        ln_registry: ${{ secrets.JFROG_REGISTRY }}
+        ln_docker_repo: ${{ secrets.JFROG_REPOSITORY }}
         lnb_token: ${{ secrets.LNB_TOKEN }}
         latest: 1   # this should only be set on the current minor branch
         build_ln: 1

+ 18 - 6
dockerfiles/action.yml

@@ -13,18 +13,18 @@ inputs:
   password:
     description: 'The login password for docker hub'
     required: true
-  build_type:
-    description: 'The build type - Debug, RelWithDebInfo, or Release'
-    required: false
-  build_label:
-    description: 'The docker version tag'
-    required: false
   docker_repo:
     description: 'The name of the docker repository to pull and push to/from'
     required: false
   registry:
     description: 'The docker image registry to log in to for image pushes'
     required: false
+  build_type:
+    description: 'The build type - Debug, RelWithDebInfo, or Release'
+    required: false
+  build_label:
+    description: 'The docker version tag'
+    required: false
   latest:
     description: 'Set to 1 to also tag as latest when maturity is release'
     required: false
@@ -37,6 +37,18 @@ inputs:
   build_ln:
     description: 'Build the ln images'
     required: false
+  ln_username:
+    description: 'The login username for ln repository'
+    required: true
+  ln_password:
+    description: 'The login password for ln repository'
+    required: true
+  ln_docker_repo:
+    description: 'The name of the docker repository to push ln images to'
+    required: false
+  ln_registry:
+    description: 'The docker image registry to log in to for ln image pushes'
+    required: false
 outputs:
   tag:
     description: 'Is the tag, which was pushed'

+ 12 - 6
dockerfiles/buildall-common.sh

@@ -26,6 +26,7 @@ BUILD_LABEL=${BUILD_TAG}                        # The docker hub label for all o
 BUILD_USER=hpcc-systems                         # The github repo owner
 BUILD_TYPE=                                     # Set to Debug for a debug build, leave blank for default (RelWithDebInfo)
 DOCKER_REPO=hpccsystems
+DEST_DOCKER_REGISTRY=docker.io
 USE_CPPUNIT=1
 
 # These values are set in a GitHub workflow build
@@ -34,6 +35,10 @@ USE_CPPUNIT=1
 [[ -n ${INPUT_BUILD_VER} ]] && BUILD_TAG=${INPUT_BUILD_VER}
 [[ -n ${INPUT_DOCKER_REPO} ]] && DOCKER_REPO=${INPUT_DOCKER_REPO}
 
+DEST_DOCKER_REPO=${DOCKER_REPO}
+[[ -n ${INPUT_LN_DOCKER_REPO} ]] && DEST_DOCKER_REPO=${INPUT_LN_DOCKER_REPO}
+[[ -n ${INPUT_LN_REGISTRY} ]] && DEST_DOCKER_REGISTRY=${INPUT_LN_REGISTRY}
+
 if [[ -n ${INPUT_BUILD_THREADS} ]] ; then
   BUILD_THREADS=$INPUT_BUILD_THREADS
 fi
@@ -77,10 +82,11 @@ build_image() {
 
   [[ -z ${buildTag} ]] && buildTag=$BUILD_TAG
 
-  if [ "$rebuild" = "1" ] || ! docker pull ${DOCKER_REPO}/${name}:${label} ; then
-    docker image build -t ${DOCKER_REPO}/${name}:${label} \
+  if [ "$rebuild" = "1" ] || ! docker pull ${DEST_DOCKER_REGISTRY}/${DOCKER_REPO}/${name}:${label} ; then
+    docker image build -t ${DEST_DOCKER_REGISTRY}/${DEST_DOCKER_REPO}/${name}:${label} \
        --build-arg BASE_VER=${BASE_VER} \
        --build-arg DOCKER_REPO=${DOCKER_REPO} \
+       --build-arg DEST_DOCKER_REPO=${DEST_DOCKER_REGISTRY}/${DEST_DOCKER_REPO} \
        --build-arg BUILD_TAG=${buildTag} \
        --build-arg BUILD_LABEL=${BUILD_LABEL} \
        --build-arg BUILD_USER=${BUILD_USER} \
@@ -97,14 +103,14 @@ push_image() {
   local name=$1
   local label=$2
   if [ "$LATEST" = "1" ] ; then
-    docker tag ${DOCKER_REPO}/${name}:${label} ${DOCKER_REPO}/${name}:latest
+    docker tag ${DEST_DOCKER_REGISTRY}/${DEST_DOCKER_REPO}/${name}:${label} ${DEST_DOCKER_REGISTRY}/${DEST_DOCKER_REPO}/${name}:latest
     if [ "$PUSH" = "1" ] ; then
-      docker push ${DOCKER_REPO}/${name}:${label}
-      docker push ${DOCKER_REPO}/${name}:latest
+      docker push ${DEST_DOCKER_REGISTRY}/${DEST_DOCKER_REPO}/${name}:${label}
+      docker push ${DEST_DOCKER_REGISTRY}/${DEST_DOCKER_REPO}/${name}:latest
     fi
   else
     if [ "$PUSH" = "1" ] ; then
-      docker push ${DOCKER_REPO}/${name}:${label}
+      docker push ${DEST_DOCKER_REGISTRY}/${DEST_DOCKER_REPO}/${name}:${label}
     fi
   fi
 }

+ 5 - 0
dockerfiles/buildall.sh

@@ -36,6 +36,11 @@ if [[ -n ${INPUT_USERNAME} ]] ; then
   PUSH=1
 fi
 
+if [[ -n ${INPUT_LN_USERNAME} ]] ; then
+  echo ${INPUT_LN_PASSWORD} | docker login -u ${INPUT_LN_USERNAME} --password-stdin ${INPUT_LN_REGISTRY}
+  PUSH_LN=1
+fi
+
 BUILD_ML=    # all or ml,gnn,gnn-gpu
 [[ -n ${INPUT_BUILD_ML} ]] && BUILD_ML=${INPUT_BUILD_ML}
 

+ 2 - 1
dockerfiles/platform-core-ln/Dockerfile

@@ -19,7 +19,8 @@
 
 ARG BUILD_LABEL
 ARG DOCKER_REPO
-FROM ${DOCKER_REPO}/platform-build-ln:${BUILD_LABEL} as plugins
+ARG DEST_DOCKER_REPO
+FROM ${DEST_DOCKER_REPO}/platform-build-ln:${BUILD_LABEL} as plugins
 FROM ${DOCKER_REPO}/platform-core:${BUILD_LABEL}
 ENV DEBIAN_FRONTEND=noninteractive