Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 119 additions & 0 deletions .github/workflows/build-docker-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Build Community Platform

on:
workflow_call:
inputs:
community_ref:
description: 'Community Ref'
# required: true
type: string
default: community_10.0.14-1

workflow_dispatch:
inputs:
community_ref:
type: string
description: 'Community Ref'
# required: true
default: community_10.0.14-1

jobs:
build:
name: Build HPCC Test
runs-on: ubuntu-24.04
steps:
- name: Free additional disk space (remove Android SDK + Tools)
continue-on-error: true
run: |
df -h
sudo rm -rf ${ANDROID_HOME}
sudo rm -rf ${JAVA_HOME_8_X64}
sudo rm -rf ${JAVA_HOME_11_X64}
sudo rm -rf ${JAVA_HOME_17_X64}
sudo rm -rf ${JAVA_HOME_21_X64}
sudo rm -rf ${CHROMEWEBDRIVER}
sudo rm -rf ${EDGEWEBDRIVER}
sudo rm -rf ${GECKOWEBDRIVER}
sudo rm -rf ${SELENIUM_JAR_PATH}

- name: Display disk space (post free)
run: |
df -h

- name: Checkout HPCC-Platform
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/HPCC-Platform
ref: ${{ inputs.community_ref }}
fetch-depth: 0
fetch-tags: true
submodules: recursive
path: ${{ github.workspace }}/HPCC-Platform

- name: Calculate Variables
id: vars
working-directory: ${{ github.workspace }}
run: |
echo "folder_platform=${{ github.workspace }}/HPCC-Platform" >> $GITHUB_OUTPUT
echo "folder_prettygitlogs=${{ github.workspace }}/PrettyGitLogs" >> $GITHUB_OUTPUT
echo 'mount_platform=source="${{ github.workspace }}/HPCC-Platform",target=/hpcc-dev/HPCC-Platform,type=bind,consistency=cached' >> $GITHUB_OUTPUT
echo "folder_build=${{ github.workspace }}/build" >> $GITHUB_OUTPUT
echo 'mount_build=source="${{ github.workspace }}/build",target=/hpcc-dev/build,type=bind,consistency=cached' >> $GITHUB_OUTPUT
community_ref=${{ github.ref }}
echo "community_ref=$community_ref" >> $GITHUB_OUTPUT
community_tag=$(echo $community_ref | cut -d'/' -f3)
echo "community_tag=$community_tag" >> $GITHUB_OUTPUT
echo "hpcc_version=$(echo $community_tag | sed 's/community_//' | sed 's/-[0-9]$//')" >> $GITHUB_OUTPUT
echo "hpcc_version_full=$(echo $community_tag | sed 's/community_//')" >> $GITHUB_OUTPUT
community_base_ref=${{ github.event.base_ref || github.ref }}
candidate_branch=$(echo $community_base_ref | cut -d'/' -f3)
echo "candidate_branch=$candidate_branch" >> $GITHUB_OUTPUT
candidate_base_branch=$(echo $candidate_branch | awk -F'.' -v OFS='.' '{ $3="x"; print }')
echo "candidate_base_branch=$candidate_base_branch" >> $GITHUB_OUTPUT
latest_tag=$(git tag -l | grep -E "^community_[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,3}-[0-9]{1,2}" | sort -V | tail -n 1)
echo "latest_tag=$latest_tag" >> $GITHUB_OUTPUT
echo "is_latest=$(echo $latest_tag | grep -q $community_tag && echo true || echo false)" >> $GITHUB_OUTPUT
#docker_build_label=hpccsystems/platform-test
docker_build_label=xwang2713/platform-test
echo "docker_build_label=$docker_build_label" >> $GITHUB_OUTPUT

- name: Print Vars
run: echo "${{ toJson(steps.vars.outputs)}}"

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Create Docker Image
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
file: ${{ steps.vars.outputs.folder_platform }}/dockerfiles/examples/test/Dockerfile
context: ${{ steps.vars.outputs.folder_build }}
push: ${{ github.repository_owner == 'hpcc-systems' }}
build-args: |
BUILD_LABEL=${{ steps.vars.outputs.hpcc_version }}
REPO_BRANCH=${{ steps.vars.outputs.community_tag }}
GIT_BRANCH=HPCC-Platform
GIT_GIT_TEST=cloud-testing
GITHUB_TOKEN=${{ secrets.LNB_TOKEN }}
tags: |
#hpccsystems/platform-test:${{ steps.vars.outputs.hpcc_version }}
xwang2713/platform-test:${{ steps.vars.outputs.hpcc_version }}

- name: Cleanup Environment
if: always()
run: rm -f ${{ steps.vars.outputs.folder_build }}/private.key

- name: Upload error logs
if: ${{ failure() || cancelled() }}
uses: actions/upload-artifact@v4
with:
name: build-platform-test-logs
path: ${{ steps.vars.outputs.folder_build }}/**/*.log
74 changes: 74 additions & 0 deletions dockerfiles/examples/test/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
##############################################################################
#
# HPCC SYSTEMS software Copyright (C) 2020 HPCC Systems®.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##############################################################################

# Create base container image to be used by all HPCC processes
# MORE - some of these dependencies are probably not needed by all derived containers - perhaps we should move them
# Others may not be wanted at all in container mode - scikit example??

ARG BUILD_LABEL=
ARG DOCKER_REPO=hpccsystems
FROM ${DOCKER_REPO}/platform-core:${BUILD_LABEL}
#FROM hpccsystems/platform-core:9.8.44

ARG GITHUB_TOKEN=
ARG REPO_BRANCH=
ARG TEST_REPO="cloud-testing.git"
ENV GIT_BRANCH=${REPO_BRANCH}
ENV GIT_TEST_REPO=${TEST_REPO}
USER root

# Machine Learning Dependencies
RUN apt-get update && apt-get install -y python3 python3-pip --fix-missing
RUN apt-get install -y libsvm-dev libsvm-tools bc wget vim
RUN python3 -m pip install --upgrade pip
RUN pip3 install requests

# Install Selenium
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt-get install -y ./google-chrome-stable_current_amd64.deb
RUN rm -rf ./google-chrome-stable_current_amd64.deb
RUN pip3 install selenium
RUN pip3 install webdriver-manager
RUN pip3 install requests
RUN apt-get update && apt-get install -y net-tools ldap-utils --fix-missing

USER hpcc
RUN git config --global http.version HTTP/2 && \
cd /home/hpcc && git clone https://github.com/hpcc-systems/HPCC-Platform.git

# git config --global http.postBuffer 524288000 && \
#RUN cd /home/hpcc/HPCC-Platform && git checkout community_9.8.44-1
RUN echo "git checkout ${GIT_BRANCH}"
RUN cd /home/hpcc/HPCC-Platform && git checkout ${GIT_BRANCH}

RUN cd /home/hpcc && git clone https://oauth2:${GITHUB_TOKEN}@github.com/hpcc-systems/${GIT_TEST_REPO}

RUN mkdir -p /home/hpcc/test/BVT
RUN mkdir -p /home/hpcc/test/ECLWatch
RUN mkdir -p /home/hpcc/test/data-tutorial
RUN mkdir -p /home/hpcc/test/roxie
RUN mkdir -p /home/hpcc/tmp
RUN cp -r /home/hpcc/cloud-testing/bin /home/hpcc/test/
RUN cp /home/hpcc/cloud-testing/BVT/bvt.sh /home/hpcc/test/BVT/
RUN cp -r /home/hpcc/cloud-testing/ECLWatch/playground /home/hpcc/test/ECLWatch/
RUN cp -r /home/hpcc/cloud-testing/data-tutorial /home/hpcc/test/
RUN cp -r /home/hpcc/cloud-testing/roxie/commandline_test /home/hpcc/test/roxie/

RUN rm -rf /home/hpcc/cloud-testing

#RUN mkdir -p /home/hpcc/test/data
#RUN cd /home/hpcc/test/data && wget https://cdn.hpccsystems.com/install/docs/3_8_0_8rc_CE/OriginalPerson