From db0f8dec8ff65aca1ada0958cbde5f1648e991ad Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 10 Aug 2023 13:24:50 -0500 Subject: [PATCH 01/75] first test --- .github/workflows/docker.yml | 107 +++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..a755e234 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,107 @@ +name: Docker + +# TODO: post an alert to incore-alerts slack channel when there is a failure on develop or main branches + +on: + push: + branches: + - main + - develop + - 'release/*' + + pull_request: + branches: + - main + - develop + - 'release/*' + +env: + MAIN_REPO: ncsa/standalone-smm-analytics + +jobs: + docker: + runs-on: ubuntu-latest + needs: unit_tests + strategy: + fail-fast: true + matrix: + name: + - autophrase + - classification_predict + - classification_split + - classification_train + include: + - name: autophrase + dockerfile: Dockerfile + docker_location: socialmediamacroscope/autophrase + - name: classification_predict + dockerfile: Dockerfile + docker_location: socialmediamacroscope/classification_predict + - name: classification_split + dockerfile: Dockerfile + docker_location: socialmediamacroscope/classification_split + - name: classification_train + dockerfile: Dockerfile + docker_location: socialmediamacroscope/classification_train + + steps: + - name: version information and set envs + run: | + if [ "${{ github.event.release.target_commitish }}" != "" ]; then + BRANCH="${{ github.event.release.target_commitish }}" + elif [[ "${{github.event_name}}" == "pull_request" ]]; then + BRANCH="PR-${{github.event.pull_request.number}}" + else + if [[ $GITHUB_REF =~ "release/" ]]; then + BRANCH="release" + else + BRANCH=${GITHUB_REF##*/} + fi + fi + + echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV + version=$(cat ./server/build.gradle | grep "archiveVersion" | head -1 | awk -F= "{ print $2 }" | sed "s/[archiveVersion =,',]//g") + if [ "$BRANCH" == "main" ]; then + tags="latest" + oldversion="" + while [ "${oldversion}" != "${version}" ]; do + oldversion="${version}" + tags="${tags},${version}" + version=${version%.*} + done + echo "VERSION=${version}" >> $GITHUB_ENV + echo "TAGS=${tags}" >> $GITHUB_ENV + elif [ "$BRANCH" == "release" ]; then + echo "VERSION=${version}-rc" >> $GITHUB_ENV + echo "TAGS=${version}-rc" >> $GITHUB_ENV + elif [ "$BRANCH" == "develop" ]; then + echo "VERSION=develop" >> $GITHUB_ENV + echo "TAGS=develop" >> $GITHUB_ENV + else + echo "VERSION=testing" >> $GITHUB_ENV + STRIPPED_TAGS=${BRANCH/\#/_} + echo "TAGS=${STRIPPED_TAGS}" >> $GITHUB_ENV + fi + + - name: Build docker image + if: | + github.repository == env.MAIN_REPO && + (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main' || env.GITHUB_BRANCH == 'release') + uses: elgohr/Publish-Docker-Github-Action@3.04 + with: + dockerfile: ${{ matrix.dockerfile }} + name: ${{ matrix.hub_project }} + no_push: true + + - name: Publish docker image to Docker hub + if: | + github.repository == env.MAIN_REPO && + (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main'|| env.GITHUB_BRANCH == 'release') + uses: elgohr/Publish-Docker-Github-Action@3.04 + with: + dockerfile: ${{ matrix.dockerfile }} + registry: hub.docker.com + name: ${{ matrix.docker_location }} + username: ${{ secrets.HUB_USERNAME }} + password: ${{ secrets.HUB_PASSWORD }} + tags: "${{ env.TAGS }}" From 697be11a10f98c126b5905a4204795ee76bcbfcc Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 10 Aug 2023 13:30:10 -0500 Subject: [PATCH 02/75] added name --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a755e234..20d7dafb 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -20,6 +20,7 @@ env: jobs: docker: + name: Build and Push Docker runs-on: ubuntu-latest needs: unit_tests strategy: From 657eb252ce6ae2c884568dad6c70204860455978 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 10 Aug 2023 13:32:29 -0500 Subject: [PATCH 03/75] remove dependency --- .github/workflows/docker.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 20d7dafb..7fbca8d1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -22,7 +22,6 @@ jobs: docker: name: Build and Push Docker runs-on: ubuntu-latest - needs: unit_tests strategy: fail-fast: true matrix: From b281e701b09acdc520125473041bc8cfd1bb0f14 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 10 Aug 2023 13:37:04 -0500 Subject: [PATCH 04/75] second try --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7fbca8d1..fd5c3696 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -92,6 +92,7 @@ jobs: dockerfile: ${{ matrix.dockerfile }} name: ${{ matrix.hub_project }} no_push: true + workdir: ${{ matrix.hub_project }} - name: Publish docker image to Docker hub if: | From ee77bf5e7a30c50b92f611de5b3c6e97784e8bb3 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 10 Aug 2023 13:39:22 -0500 Subject: [PATCH 05/75] change variable name --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index fd5c3696..b15fe930 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -90,9 +90,9 @@ jobs: uses: elgohr/Publish-Docker-Github-Action@3.04 with: dockerfile: ${{ matrix.dockerfile }} - name: ${{ matrix.hub_project }} + name: ${{ matrix.docker_location }} no_push: true - workdir: ${{ matrix.hub_project }} + workdir: ${{ matrix.docker_location }} - name: Publish docker image to Docker hub if: | From a35621a5f94bb72426fa10deb14694444cac66b7 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 10 Aug 2023 13:43:19 -0500 Subject: [PATCH 06/75] added work dir --- .github/workflows/docker.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b15fe930..82a7725b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -33,15 +33,19 @@ jobs: include: - name: autophrase dockerfile: Dockerfile + work_dir: autophrase docker_location: socialmediamacroscope/autophrase - name: classification_predict dockerfile: Dockerfile docker_location: socialmediamacroscope/classification_predict + work_dir: classification_split - name: classification_split dockerfile: Dockerfile docker_location: socialmediamacroscope/classification_split + work_dir: classification_split - name: classification_train dockerfile: Dockerfile + work_dir: classification_train docker_location: socialmediamacroscope/classification_train steps: @@ -92,7 +96,7 @@ jobs: dockerfile: ${{ matrix.dockerfile }} name: ${{ matrix.docker_location }} no_push: true - workdir: ${{ matrix.docker_location }} + workdir: ${{ matrix.work_dir }} - name: Publish docker image to Docker hub if: | From d29fd27a92e4149b2dfcd9a7298bc78960ab70be Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 10 Aug 2023 13:46:15 -0500 Subject: [PATCH 07/75] rearranged variable location --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 82a7725b..d10f55d2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -37,12 +37,12 @@ jobs: docker_location: socialmediamacroscope/autophrase - name: classification_predict dockerfile: Dockerfile - docker_location: socialmediamacroscope/classification_predict work_dir: classification_split + docker_location: socialmediamacroscope/classification_predict - name: classification_split dockerfile: Dockerfile - docker_location: socialmediamacroscope/classification_split work_dir: classification_split + docker_location: socialmediamacroscope/classification_split - name: classification_train dockerfile: Dockerfile work_dir: classification_train From 7db18a61b95bf9583a28fd7e1f4eeec1491050dc Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 10 Aug 2023 13:52:30 -0500 Subject: [PATCH 08/75] changed file path --- .github/workflows/docker.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d10f55d2..9cba8213 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -33,19 +33,19 @@ jobs: include: - name: autophrase dockerfile: Dockerfile - work_dir: autophrase + work_dir: rabbitmq/autophrase docker_location: socialmediamacroscope/autophrase - name: classification_predict dockerfile: Dockerfile - work_dir: classification_split + work_dir: rabbitmq/classification_split docker_location: socialmediamacroscope/classification_predict - name: classification_split dockerfile: Dockerfile - work_dir: classification_split + work_dir: rabbitmq/classification_split docker_location: socialmediamacroscope/classification_split - name: classification_train dockerfile: Dockerfile - work_dir: classification_train + work_dir: rabbitmq/classification_train docker_location: socialmediamacroscope/classification_train steps: From c2a2e3a476d118428d77e2c230204c6769d29af5 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 10 Aug 2023 16:04:34 -0500 Subject: [PATCH 09/75] saving purpose --- .github/workflows/docker.yml | 172 ++++++++++++++++++++++------------- 1 file changed, 111 insertions(+), 61 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9cba8213..bb2a31c3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -18,54 +18,124 @@ on: env: MAIN_REPO: ncsa/standalone-smm-analytics +#jobs: +# docker: +# name: Build and Push Docker +# runs-on: ubuntu-latest +# strategy: +# fail-fast: true +# matrix: +# name: +# - autophrase +# - classification_predict +# - classification_split +# - classification_train +# include: +# - name: autophrase +# dockerfile: Dockerfile +# work_dir: rabbitmq/autophrase +# docker_location: socialmediamacroscope/autophrase +# - name: classification_predict +# dockerfile: Dockerfile +# work_dir: rabbitmq/classification_split +# docker_location: socialmediamacroscope/classification_predict +# - name: classification_split +# dockerfile: Dockerfile +# work_dir: rabbitmq/classification_split +# docker_location: socialmediamacroscope/classification_split +# - name: classification_train +# dockerfile: Dockerfile +# work_dir: rabbitmq/classification_train +# docker_location: socialmediamacroscope/classification_train +# +# steps: +# - name: version information and set envs +# run: | +# if [ "${{ github.event.release.target_commitish }}" != "" ]; then +# BRANCH="${{ github.event.release.target_commitish }}" +# elif [[ "${{github.event_name}}" == "pull_request" ]]; then +# BRANCH="PR-${{github.event.pull_request.number}}" +# else +# if [[ $GITHUB_REF =~ "release/" ]]; then +# BRANCH="release" +# else +# BRANCH=${GITHUB_REF##*/} +# fi +# fi +# +# echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV +# version=$(cat ./server/build.gradle | grep "archiveVersion" | head -1 | awk -F= "{ print $2 }" | sed "s/[archiveVersion =,',]//g") +# if [ "$BRANCH" == "main" ]; then +# tags="latest" +# oldversion="" +# while [ "${oldversion}" != "${version}" ]; do +# oldversion="${version}" +# tags="${tags},${version}" +# version=${version%.*} +# done +# echo "VERSION=${version}" >> $GITHUB_ENV +# echo "TAGS=${tags}" >> $GITHUB_ENV +# elif [ "$BRANCH" == "release" ]; then +# echo "VERSION=${version}-rc" >> $GITHUB_ENV +# echo "TAGS=${version}-rc" >> $GITHUB_ENV +# elif [ "$BRANCH" == "develop" ]; then +# echo "VERSION=develop" >> $GITHUB_ENV +# echo "TAGS=develop" >> $GITHUB_ENV +# else +# echo "VERSION=testing" >> $GITHUB_ENV +# STRIPPED_TAGS=${BRANCH/\#/_} +# echo "TAGS=${STRIPPED_TAGS}" >> $GITHUB_ENV +# fi +# +# - name: Build docker image +# if: | +# github.repository == env.MAIN_REPO && +# (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main' || env.GITHUB_BRANCH == 'release') +# uses: elgohr/Publish-Docker-Github-Action@3.04 +# with: +# dockerfile: ${{ matrix.dockerfile }} +# name: ${{ matrix.docker_location }} +# no_push: true +# workdir: ${{ matrix.work_dir }} +# +# - name: Publish docker image to Docker hub +# if: | +# github.repository == env.MAIN_REPO && +# (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main'|| env.GITHUB_BRANCH == 'release') +# uses: elgohr/Publish-Docker-Github-Action@3.04 +# with: +# dockerfile: ${{ matrix.dockerfile }} +# registry: hub.docker.com +# name: ${{ matrix.docker_location }} +# username: ${{ secrets.HUB_USERNAME }} +# password: ${{ secrets.HUB_PASSWORD }} +# tags: "${{ env.TAGS }}" + jobs: + + # ---------------------------------------------------------------------- + # DOCKER BUILD + # ---------------------------------------------------------------------- docker: - name: Build and Push Docker runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - name: - - autophrase - - classification_predict - - classification_split - - classification_train - include: - - name: autophrase - dockerfile: Dockerfile - work_dir: rabbitmq/autophrase - docker_location: socialmediamacroscope/autophrase - - name: classification_predict - dockerfile: Dockerfile - work_dir: rabbitmq/classification_split - docker_location: socialmediamacroscope/classification_predict - - name: classification_split - dockerfile: Dockerfile - work_dir: rabbitmq/classification_split - docker_location: socialmediamacroscope/classification_split - - name: classification_train - dockerfile: Dockerfile - work_dir: rabbitmq/classification_train - docker_location: socialmediamacroscope/classification_train steps: - - name: version information and set envs + # checkout source code + - uses: actions/checkout@v2 + + # calculate some variables that are used later + - name: version information run: | if [ "${{ github.event.release.target_commitish }}" != "" ]; then BRANCH="${{ github.event.release.target_commitish }}" - elif [[ "${{github.event_name}}" == "pull_request" ]]; then - BRANCH="PR-${{github.event.pull_request.number}}" + elif [[ $GITHUB_REF =~ pull ]]; then + BRANCH="$(echo $GITHUB_REF | sed 's#refs/pull/\([0-9]*\)/merge#PR-\1#')" else - if [[ $GITHUB_REF =~ "release/" ]]; then - BRANCH="release" - else - BRANCH=${GITHUB_REF##*/} - fi + BRANCH=${GITHUB_REF##*/} fi - echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV - version=$(cat ./server/build.gradle | grep "archiveVersion" | head -1 | awk -F= "{ print $2 }" | sed "s/[archiveVersion =,',]//g") if [ "$BRANCH" == "main" ]; then + version=$(cat package.json | grep \"version\" | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,",]//g' | tr -d '[[:space:]]') tags="latest" oldversion="" while [ "${oldversion}" != "${version}" ]; do @@ -75,38 +145,18 @@ jobs: done echo "VERSION=${version}" >> $GITHUB_ENV echo "TAGS=${tags}" >> $GITHUB_ENV - elif [ "$BRANCH" == "release" ]; then - echo "VERSION=${version}-rc" >> $GITHUB_ENV - echo "TAGS=${version}-rc" >> $GITHUB_ENV elif [ "$BRANCH" == "develop" ]; then echo "VERSION=develop" >> $GITHUB_ENV echo "TAGS=develop" >> $GITHUB_ENV else echo "VERSION=testing" >> $GITHUB_ENV - STRIPPED_TAGS=${BRANCH/\#/_} - echo "TAGS=${STRIPPED_TAGS}" >> $GITHUB_ENV + echo "TAGS=${BRANCH}" >> $GITHUB_ENV fi - - name: Build docker image - if: | - github.repository == env.MAIN_REPO && - (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main' || env.GITHUB_BRANCH == 'release') + # build image + - name: Build swagger api image uses: elgohr/Publish-Docker-Github-Action@3.04 with: - dockerfile: ${{ matrix.dockerfile }} - name: ${{ matrix.docker_location }} + name: autophrase no_push: true - workdir: ${{ matrix.work_dir }} - - - name: Publish docker image to Docker hub - if: | - github.repository == env.MAIN_REPO && - (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main'|| env.GITHUB_BRANCH == 'release') - uses: elgohr/Publish-Docker-Github-Action@3.04 - with: - dockerfile: ${{ matrix.dockerfile }} - registry: hub.docker.com - name: ${{ matrix.docker_location }} - username: ${{ secrets.HUB_USERNAME }} - password: ${{ secrets.HUB_PASSWORD }} - tags: "${{ env.TAGS }}" + workdir: rabbitmq/autophrase From d11e4a88531f12229a76ceae28de6745c0a00506 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 10:55:46 -0600 Subject: [PATCH 10/75] intial test --- .github/workflows/docker.yml | 216 +++++++++++++++++++---------------- 1 file changed, 116 insertions(+), 100 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index bb2a31c3..93586e86 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -6,110 +6,110 @@ on: push: branches: - main - - develop - - 'release/*' +# - develop +# - 'release/*' pull_request: branches: - main - - develop - - 'release/*' +# - develop +# - 'release/*' env: MAIN_REPO: ncsa/standalone-smm-analytics -#jobs: -# docker: -# name: Build and Push Docker -# runs-on: ubuntu-latest -# strategy: -# fail-fast: true -# matrix: -# name: -# - autophrase -# - classification_predict -# - classification_split -# - classification_train -# include: -# - name: autophrase -# dockerfile: Dockerfile -# work_dir: rabbitmq/autophrase -# docker_location: socialmediamacroscope/autophrase -# - name: classification_predict -# dockerfile: Dockerfile -# work_dir: rabbitmq/classification_split -# docker_location: socialmediamacroscope/classification_predict -# - name: classification_split -# dockerfile: Dockerfile -# work_dir: rabbitmq/classification_split -# docker_location: socialmediamacroscope/classification_split -# - name: classification_train -# dockerfile: Dockerfile -# work_dir: rabbitmq/classification_train -# docker_location: socialmediamacroscope/classification_train -# -# steps: -# - name: version information and set envs -# run: | -# if [ "${{ github.event.release.target_commitish }}" != "" ]; then -# BRANCH="${{ github.event.release.target_commitish }}" -# elif [[ "${{github.event_name}}" == "pull_request" ]]; then -# BRANCH="PR-${{github.event.pull_request.number}}" -# else -# if [[ $GITHUB_REF =~ "release/" ]]; then -# BRANCH="release" -# else -# BRANCH=${GITHUB_REF##*/} -# fi -# fi -# -# echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV -# version=$(cat ./server/build.gradle | grep "archiveVersion" | head -1 | awk -F= "{ print $2 }" | sed "s/[archiveVersion =,',]//g") -# if [ "$BRANCH" == "main" ]; then -# tags="latest" -# oldversion="" -# while [ "${oldversion}" != "${version}" ]; do -# oldversion="${version}" -# tags="${tags},${version}" -# version=${version%.*} -# done -# echo "VERSION=${version}" >> $GITHUB_ENV -# echo "TAGS=${tags}" >> $GITHUB_ENV -# elif [ "$BRANCH" == "release" ]; then -# echo "VERSION=${version}-rc" >> $GITHUB_ENV -# echo "TAGS=${version}-rc" >> $GITHUB_ENV -# elif [ "$BRANCH" == "develop" ]; then -# echo "VERSION=develop" >> $GITHUB_ENV -# echo "TAGS=develop" >> $GITHUB_ENV -# else -# echo "VERSION=testing" >> $GITHUB_ENV -# STRIPPED_TAGS=${BRANCH/\#/_} -# echo "TAGS=${STRIPPED_TAGS}" >> $GITHUB_ENV -# fi -# -# - name: Build docker image -# if: | -# github.repository == env.MAIN_REPO && -# (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main' || env.GITHUB_BRANCH == 'release') -# uses: elgohr/Publish-Docker-Github-Action@3.04 -# with: -# dockerfile: ${{ matrix.dockerfile }} -# name: ${{ matrix.docker_location }} -# no_push: true -# workdir: ${{ matrix.work_dir }} -# -# - name: Publish docker image to Docker hub -# if: | -# github.repository == env.MAIN_REPO && -# (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main'|| env.GITHUB_BRANCH == 'release') -# uses: elgohr/Publish-Docker-Github-Action@3.04 -# with: -# dockerfile: ${{ matrix.dockerfile }} -# registry: hub.docker.com -# name: ${{ matrix.docker_location }} -# username: ${{ secrets.HUB_USERNAME }} -# password: ${{ secrets.HUB_PASSWORD }} -# tags: "${{ env.TAGS }}" +jobs: + docker: + name: Build and Push Docker + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + name: + - autophrase + - classification_predict + - classification_split + - classification_train + include: + - name: autophrase + dockerfile: Dockerfile + work_dir: rabbitmq/autophrase + docker_location: socialmediamacroscope/autophrase + - name: classification_predict + dockerfile: Dockerfile + work_dir: rabbitmq/classification_split + docker_location: socialmediamacroscope/classification_predict + - name: classification_split + dockerfile: Dockerfile + work_dir: rabbitmq/classification_split + docker_location: socialmediamacroscope/classification_split + - name: classification_train + dockerfile: Dockerfile + work_dir: rabbitmq/classification_train + docker_location: socialmediamacroscope/classification_train + + steps: + - name: version information and set envs + run: | + if [ "${{ github.event.release.target_commitish }}" != "" ]; then + BRANCH="${{ github.event.release.target_commitish }}" + elif [[ "${{github.event_name}}" == "pull_request" ]]; then + BRANCH="PR-${{github.event.pull_request.number}}" + else + if [[ $GITHUB_REF =~ "release/" ]]; then + BRANCH="release" + else + BRANCH=${GITHUB_REF##*/} + fi + fi + + echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV + version=$(cat ./server/build.gradle | grep "archiveVersion" | head -1 | awk -F= "{ print $2 }" | sed "s/[archiveVersion =,',]//g") + if [ "$BRANCH" == "main" ]; then + tags="latest" + oldversion="" + while [ "${oldversion}" != "${version}" ]; do + oldversion="${version}" + tags="${tags},${version}" + version=${version%.*} + done + echo "VERSION=${version}" >> $GITHUB_ENV + echo "TAGS=${tags}" >> $GITHUB_ENV + elif [ "$BRANCH" == "release" ]; then + echo "VERSION=${version}-rc" >> $GITHUB_ENV + echo "TAGS=${version}-rc" >> $GITHUB_ENV + elif [ "$BRANCH" == "develop" ]; then + echo "VERSION=develop" >> $GITHUB_ENV + echo "TAGS=develop" >> $GITHUB_ENV + else + echo "VERSION=testing" >> $GITHUB_ENV + STRIPPED_TAGS=${BRANCH/\#/_} + echo "TAGS=${STRIPPED_TAGS}" >> $GITHUB_ENV + fi + + - name: Build docker image + if: | + github.repository == env.MAIN_REPO && + (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main' || env.GITHUB_BRANCH == 'release') + uses: elgohr/Publish-Docker-Github-Action@3.04 + with: + dockerfile: ${{ matrix.dockerfile }} + name: ${{ matrix.docker_location }} + no_push: true + workdir: ${{ matrix.work_dir }} + + - name: Publish docker image to Docker hub + if: | + github.repository == env.MAIN_REPO && + (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main'|| env.GITHUB_BRANCH == 'release') + uses: elgohr/Publish-Docker-Github-Action@3.04 + with: + dockerfile: ${{ matrix.dockerfile }} + registry: hub.docker.com + name: ${{ matrix.docker_location }} + username: ${{ secrets.HUB_USERNAME }} + password: ${{ secrets.HUB_PASSWORD }} + tags: "${{ env.TAGS }}" jobs: @@ -153,10 +153,26 @@ jobs: echo "TAGS=${BRANCH}" >> $GITHUB_ENV fi - # build image - - name: Build swagger api image + - name: Build docker image + if: | + github.repository == env.MAIN_REPO && +# (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main' || env.GITHUB_BRANCH == 'release') + (github.event_name == 'env.GITHUB_BRANCH == 'pull_request') uses: elgohr/Publish-Docker-Github-Action@3.04 with: - name: autophrase + dockerfile: ${{ matrix.dockerfile }} + name: ${{ matrix.hub_project }} no_push: true - workdir: rabbitmq/autophrase + +# - name: Publish docker image to NCSA hub +# if: | +# github.repository == env.MAIN_REPO && +# (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main'|| env.GITHUB_BRANCH == 'release') +# uses: elgohr/Publish-Docker-Github-Action@3.04 +# with: +# dockerfile: ${{ matrix.dockerfile }} +# registry: hub.ncsa.illinois.edu +# name: ${{ matrix.hub_project }} +# username: ${{ secrets.HUB_USERNAME }} +# password: ${{ secrets.HUB_PASSWORD }} +# tags: "${{ env.TAGS }}" From 5caee627fdb07cd151cbe369ffcc829966305faa Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 11:00:16 -0600 Subject: [PATCH 11/75] Update docker.yml --- .github/workflows/docker.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 93586e86..5484f729 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -152,7 +152,6 @@ jobs: echo "VERSION=testing" >> $GITHUB_ENV echo "TAGS=${BRANCH}" >> $GITHUB_ENV fi - - name: Build docker image if: | github.repository == env.MAIN_REPO && From 277f9ee7bf755c5d0f43814c3d758ee300e22b6a Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 11:02:11 -0600 Subject: [PATCH 12/75] Update docker.yml --- .github/workflows/docker.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5484f729..0375ce1b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -111,8 +111,6 @@ jobs: password: ${{ secrets.HUB_PASSWORD }} tags: "${{ env.TAGS }}" -jobs: - # ---------------------------------------------------------------------- # DOCKER BUILD # ---------------------------------------------------------------------- @@ -152,6 +150,7 @@ jobs: echo "VERSION=testing" >> $GITHUB_ENV echo "TAGS=${BRANCH}" >> $GITHUB_ENV fi + - name: Build docker image if: | github.repository == env.MAIN_REPO && From e29c2b8314b5502cc237fbb7d57597a966ec439c Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 11:04:37 -0600 Subject: [PATCH 13/75] Second test --- .github/workflows/docker.yml | 134 +++++++++++++++++------------------ 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0375ce1b..dc9959e3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -98,79 +98,79 @@ jobs: no_push: true workdir: ${{ matrix.work_dir }} - - name: Publish docker image to Docker hub - if: | - github.repository == env.MAIN_REPO && - (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main'|| env.GITHUB_BRANCH == 'release') - uses: elgohr/Publish-Docker-Github-Action@3.04 - with: - dockerfile: ${{ matrix.dockerfile }} - registry: hub.docker.com - name: ${{ matrix.docker_location }} - username: ${{ secrets.HUB_USERNAME }} - password: ${{ secrets.HUB_PASSWORD }} - tags: "${{ env.TAGS }}" - - # ---------------------------------------------------------------------- - # DOCKER BUILD - # ---------------------------------------------------------------------- - docker: - runs-on: ubuntu-latest - - steps: - # checkout source code - - uses: actions/checkout@v2 - - # calculate some variables that are used later - - name: version information - run: | - if [ "${{ github.event.release.target_commitish }}" != "" ]; then - BRANCH="${{ github.event.release.target_commitish }}" - elif [[ $GITHUB_REF =~ pull ]]; then - BRANCH="$(echo $GITHUB_REF | sed 's#refs/pull/\([0-9]*\)/merge#PR-\1#')" - else - BRANCH=${GITHUB_REF##*/} - fi - echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV - if [ "$BRANCH" == "main" ]; then - version=$(cat package.json | grep \"version\" | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,",]//g' | tr -d '[[:space:]]') - tags="latest" - oldversion="" - while [ "${oldversion}" != "${version}" ]; do - oldversion="${version}" - tags="${tags},${version}" - version=${version%.*} - done - echo "VERSION=${version}" >> $GITHUB_ENV - echo "TAGS=${tags}" >> $GITHUB_ENV - elif [ "$BRANCH" == "develop" ]; then - echo "VERSION=develop" >> $GITHUB_ENV - echo "TAGS=develop" >> $GITHUB_ENV - else - echo "VERSION=testing" >> $GITHUB_ENV - echo "TAGS=${BRANCH}" >> $GITHUB_ENV - fi - - - name: Build docker image - if: | - github.repository == env.MAIN_REPO && -# (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main' || env.GITHUB_BRANCH == 'release') - (github.event_name == 'env.GITHUB_BRANCH == 'pull_request') - uses: elgohr/Publish-Docker-Github-Action@3.04 - with: - dockerfile: ${{ matrix.dockerfile }} - name: ${{ matrix.hub_project }} - no_push: true - -# - name: Publish docker image to NCSA hub +# - name: Publish docker image to Docker hub # if: | # github.repository == env.MAIN_REPO && # (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main'|| env.GITHUB_BRANCH == 'release') # uses: elgohr/Publish-Docker-Github-Action@3.04 # with: # dockerfile: ${{ matrix.dockerfile }} -# registry: hub.ncsa.illinois.edu -# name: ${{ matrix.hub_project }} +# registry: hub.docker.com +# name: ${{ matrix.docker_location }} # username: ${{ secrets.HUB_USERNAME }} # password: ${{ secrets.HUB_PASSWORD }} # tags: "${{ env.TAGS }}" +# +# # ---------------------------------------------------------------------- +# # DOCKER BUILD +# # ---------------------------------------------------------------------- +# docker: +# runs-on: ubuntu-latest +# +# steps: +# # checkout source code +# - uses: actions/checkout@v2 +# +# # calculate some variables that are used later +# - name: version information +# run: | +# if [ "${{ github.event.release.target_commitish }}" != "" ]; then +# BRANCH="${{ github.event.release.target_commitish }}" +# elif [[ $GITHUB_REF =~ pull ]]; then +# BRANCH="$(echo $GITHUB_REF | sed 's#refs/pull/\([0-9]*\)/merge#PR-\1#')" +# else +# BRANCH=${GITHUB_REF##*/} +# fi +# echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV +# if [ "$BRANCH" == "main" ]; then +# version=$(cat package.json | grep \"version\" | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,",]//g' | tr -d '[[:space:]]') +# tags="latest" +# oldversion="" +# while [ "${oldversion}" != "${version}" ]; do +# oldversion="${version}" +# tags="${tags},${version}" +# version=${version%.*} +# done +# echo "VERSION=${version}" >> $GITHUB_ENV +# echo "TAGS=${tags}" >> $GITHUB_ENV +# elif [ "$BRANCH" == "develop" ]; then +# echo "VERSION=develop" >> $GITHUB_ENV +# echo "TAGS=develop" >> $GITHUB_ENV +# else +# echo "VERSION=testing" >> $GITHUB_ENV +# echo "TAGS=${BRANCH}" >> $GITHUB_ENV +# fi +# +# - name: Build docker image +# if: | +# github.repository == env.MAIN_REPO && +## (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main' || env.GITHUB_BRANCH == 'release') +# (github.event_name == 'env.GITHUB_BRANCH == 'pull_request') +# uses: elgohr/Publish-Docker-Github-Action@3.04 +# with: +# dockerfile: ${{ matrix.dockerfile }} +# name: ${{ matrix.hub_project }} +# no_push: true +# +## - name: Publish docker image to NCSA hub +## if: | +## github.repository == env.MAIN_REPO && +## (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main'|| env.GITHUB_BRANCH == 'release') +## uses: elgohr/Publish-Docker-Github-Action@3.04 +## with: +## dockerfile: ${{ matrix.dockerfile }} +## registry: hub.ncsa.illinois.edu +## name: ${{ matrix.hub_project }} +## username: ${{ secrets.HUB_USERNAME }} +## password: ${{ secrets.HUB_PASSWORD }} +## tags: "${{ env.TAGS }}" From 96d5fcbb9f549fbddd67b9c8235f691d2bbf1dab Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 11:07:17 -0600 Subject: [PATCH 14/75] third test --- .github/workflows/docker.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index dc9959e3..f8f764b9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -33,19 +33,19 @@ jobs: include: - name: autophrase dockerfile: Dockerfile - work_dir: rabbitmq/autophrase + work_dir: containerized_analytics/smile/autophrase docker_location: socialmediamacroscope/autophrase - name: classification_predict dockerfile: Dockerfile - work_dir: rabbitmq/classification_split + work_dir: containerized_analytics/smile/classification_split docker_location: socialmediamacroscope/classification_predict - name: classification_split dockerfile: Dockerfile - work_dir: rabbitmq/classification_split + work_dir: containerized_analytics/smile/classification_split docker_location: socialmediamacroscope/classification_split - name: classification_train dockerfile: Dockerfile - work_dir: rabbitmq/classification_train + work_dir: containerized_analytics/smile/classification_train docker_location: socialmediamacroscope/classification_train steps: From 4908c9ffe3b39970cb3436ae051ceea7fc664deb Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 11:09:24 -0600 Subject: [PATCH 15/75] 4th test --- .github/workflows/docker.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f8f764b9..a37912f6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -98,18 +98,19 @@ jobs: no_push: true workdir: ${{ matrix.work_dir }} -# - name: Publish docker image to Docker hub -# if: | -# github.repository == env.MAIN_REPO && + - name: Publish docker image to Docker hub + if: | + github.repository == env.MAIN_REPO && # (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main'|| env.GITHUB_BRANCH == 'release') -# uses: elgohr/Publish-Docker-Github-Action@3.04 -# with: -# dockerfile: ${{ matrix.dockerfile }} -# registry: hub.docker.com -# name: ${{ matrix.docker_location }} -# username: ${{ secrets.HUB_USERNAME }} -# password: ${{ secrets.HUB_PASSWORD }} -# tags: "${{ env.TAGS }}" + (github.event_name == env.GITHUB_BRANCH == 'main') + uses: elgohr/Publish-Docker-Github-Action@3.04 + with: + dockerfile: ${{ matrix.dockerfile }} + registry: hub.docker.com + name: ${{ matrix.docker_location }} + username: ${{ secrets.HUB_USERNAME }} + password: ${{ secrets.HUB_PASSWORD }} + tags: "${{ env.TAGS }}" # # # ---------------------------------------------------------------------- # # DOCKER BUILD From 286d3ac9e113031f75ce4806f90b5825afb41065 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 11:13:37 -0600 Subject: [PATCH 16/75] Update docker.yml --- .github/workflows/docker.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a37912f6..e5fdc024 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -101,7 +101,6 @@ jobs: - name: Publish docker image to Docker hub if: | github.repository == env.MAIN_REPO && -# (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main'|| env.GITHUB_BRANCH == 'release') (github.event_name == env.GITHUB_BRANCH == 'main') uses: elgohr/Publish-Docker-Github-Action@3.04 with: From 37b646f4f3f99c90df0459ef151ef621ec70f992 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 11:14:48 -0600 Subject: [PATCH 17/75] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e5fdc024..be2214bf 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -33,7 +33,7 @@ jobs: include: - name: autophrase dockerfile: Dockerfile - work_dir: containerized_analytics/smile/autophrase + work_dir: rabbitmq/autophrase docker_location: socialmediamacroscope/autophrase - name: classification_predict dockerfile: Dockerfile From 5cf8cb728b072fd75f7cf045863530bc1d81a537 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 11:16:24 -0600 Subject: [PATCH 18/75] Update docker.yml --- .github/workflows/docker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index be2214bf..aeac041b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -37,15 +37,15 @@ jobs: docker_location: socialmediamacroscope/autophrase - name: classification_predict dockerfile: Dockerfile - work_dir: containerized_analytics/smile/classification_split + work_dir: rabbitmq/classification_split docker_location: socialmediamacroscope/classification_predict - name: classification_split dockerfile: Dockerfile - work_dir: containerized_analytics/smile/classification_split + work_dir: rabbitmq/classification_split docker_location: socialmediamacroscope/classification_split - name: classification_train dockerfile: Dockerfile - work_dir: containerized_analytics/smile/classification_train + work_dir: rabbitmq/classification_train docker_location: socialmediamacroscope/classification_train steps: From baba45c6f0f226de138d6f5327cc4fb367f05512 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 11:18:02 -0600 Subject: [PATCH 19/75] Update docker.yml --- .github/workflows/docker.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index aeac041b..5cbf42c6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -27,26 +27,11 @@ jobs: matrix: name: - autophrase - - classification_predict - - classification_split - - classification_train include: - name: autophrase dockerfile: Dockerfile work_dir: rabbitmq/autophrase docker_location: socialmediamacroscope/autophrase - - name: classification_predict - dockerfile: Dockerfile - work_dir: rabbitmq/classification_split - docker_location: socialmediamacroscope/classification_predict - - name: classification_split - dockerfile: Dockerfile - work_dir: rabbitmq/classification_split - docker_location: socialmediamacroscope/classification_split - - name: classification_train - dockerfile: Dockerfile - work_dir: rabbitmq/classification_train - docker_location: socialmediamacroscope/classification_train steps: - name: version information and set envs From e81484f38b542ce99a8fdc1f4d0284f30cc9a297 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 11:23:31 -0600 Subject: [PATCH 20/75] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5cbf42c6..d4814725 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -30,7 +30,7 @@ jobs: include: - name: autophrase dockerfile: Dockerfile - work_dir: rabbitmq/autophrase + work_dir: /rabbitmq/autophrase docker_location: socialmediamacroscope/autophrase steps: From c05f667d7be31a4db73fddff701d9af4d8ee86b7 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 11:24:53 -0600 Subject: [PATCH 21/75] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d4814725..3858f833 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -81,7 +81,7 @@ jobs: dockerfile: ${{ matrix.dockerfile }} name: ${{ matrix.docker_location }} no_push: true - workdir: ${{ matrix.work_dir }} + # workdir: ${{ matrix.work_dir }} - name: Publish docker image to Docker hub if: | From 76a2493dd997629db0701420f144edf7283b50a9 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 11:32:54 -0600 Subject: [PATCH 22/75] Update docker.yml --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 3858f833..5cbf42c6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -30,7 +30,7 @@ jobs: include: - name: autophrase dockerfile: Dockerfile - work_dir: /rabbitmq/autophrase + work_dir: rabbitmq/autophrase docker_location: socialmediamacroscope/autophrase steps: @@ -81,7 +81,7 @@ jobs: dockerfile: ${{ matrix.dockerfile }} name: ${{ matrix.docker_location }} no_push: true - # workdir: ${{ matrix.work_dir }} + workdir: ${{ matrix.work_dir }} - name: Publish docker image to Docker hub if: | From cbc22b271e36c6514ff14a4aa7db176c8d2120fd Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 13:53:53 -0600 Subject: [PATCH 23/75] Update docker.yml --- .github/workflows/docker.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5cbf42c6..2c588632 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -72,6 +72,9 @@ jobs: echo "TAGS=${STRIPPED_TAGS}" >> $GITHUB_ENV fi + - name: Debug directory contents + run: ls -R + - name: Build docker image if: | github.repository == env.MAIN_REPO && From 9408dd45884750a75a765bf7b084fead08e3eac2 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 13:56:01 -0600 Subject: [PATCH 24/75] Update docker.yml --- .github/workflows/docker.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2c588632..3bfd3878 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -75,6 +75,10 @@ jobs: - name: Debug directory contents run: ls -R + - name: Print current working directory + run: pwd + + - name: Build docker image if: | github.repository == env.MAIN_REPO && From 7dc655e936f57b65cd6c0e422563757629519cb9 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 13:59:28 -0600 Subject: [PATCH 25/75] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 3bfd3878..966d9f9b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -30,7 +30,7 @@ jobs: include: - name: autophrase dockerfile: Dockerfile - work_dir: rabbitmq/autophrase + work_dir: standalone-smm-analytics/standalone-smm-analytics/rabbitmq/autophrase docker_location: socialmediamacroscope/autophrase steps: From 9bff365033977fda79c4a4c15c8a518c909079c2 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 14:00:36 -0600 Subject: [PATCH 26/75] Update docker.yml --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 966d9f9b..68685bf2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -29,8 +29,8 @@ jobs: - autophrase include: - name: autophrase - dockerfile: Dockerfile - work_dir: standalone-smm-analytics/standalone-smm-analytics/rabbitmq/autophrase + dockerfile: rabbitmq/autophrase/Dockerfile + work_dir: standalone-smm-analytics/standalone-smm-analytics docker_location: socialmediamacroscope/autophrase steps: From 41654c74900fe00a51ddb286ee6fdbe42bc31e23 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 14:01:50 -0600 Subject: [PATCH 27/75] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 68685bf2..e0e543b1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -88,7 +88,7 @@ jobs: dockerfile: ${{ matrix.dockerfile }} name: ${{ matrix.docker_location }} no_push: true - workdir: ${{ matrix.work_dir }} + workdir: standalone-smm-analytics/standalone-smm-analytics - name: Publish docker image to Docker hub if: | From ba379f4af5d14d108ea1730b9375ddd85f7f776c Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 14:04:34 -0600 Subject: [PATCH 28/75] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e0e543b1..af24ac98 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -88,7 +88,7 @@ jobs: dockerfile: ${{ matrix.dockerfile }} name: ${{ matrix.docker_location }} no_push: true - workdir: standalone-smm-analytics/standalone-smm-analytics + workdir: rabbitmq/autophrase - name: Publish docker image to Docker hub if: | From d24df60f0d596ca09e52c3607b9aa5e524f4f71a Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 14:06:25 -0600 Subject: [PATCH 29/75] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index af24ac98..700f9328 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -88,7 +88,7 @@ jobs: dockerfile: ${{ matrix.dockerfile }} name: ${{ matrix.docker_location }} no_push: true - workdir: rabbitmq/autophrase + #workdir: rabbitmq/autophrase - name: Publish docker image to Docker hub if: | From 2350cea87079a3395df12f125c524de3af1b971d Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 14:08:25 -0600 Subject: [PATCH 30/75] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 700f9328..17f9eaee 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -85,7 +85,7 @@ jobs: (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main' || env.GITHUB_BRANCH == 'release') uses: elgohr/Publish-Docker-Github-Action@3.04 with: - dockerfile: ${{ matrix.dockerfile }} + dockerfile: rabbitmq/autophrase/Dockerfile name: ${{ matrix.docker_location }} no_push: true #workdir: rabbitmq/autophrase From 4fa3b2e4b8799ec572389f201e2aa0d06a1ec7ec Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 14:10:40 -0600 Subject: [PATCH 31/75] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 17f9eaee..b089e988 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -86,9 +86,9 @@ jobs: uses: elgohr/Publish-Docker-Github-Action@3.04 with: dockerfile: rabbitmq/autophrase/Dockerfile + context: rabbitmq name: ${{ matrix.docker_location }} no_push: true - #workdir: rabbitmq/autophrase - name: Publish docker image to Docker hub if: | From d58647c82f89fd3ea2d432329bd9c00690e6b343 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 14:12:24 -0600 Subject: [PATCH 32/75] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b089e988..265fe128 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -86,7 +86,7 @@ jobs: uses: elgohr/Publish-Docker-Github-Action@3.04 with: dockerfile: rabbitmq/autophrase/Dockerfile - context: rabbitmq + context: ./rabbitmq/autophrase name: ${{ matrix.docker_location }} no_push: true From 3ede53ea2c8454017bf338f4e13785d149a9ef31 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 14:15:24 -0600 Subject: [PATCH 33/75] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 265fe128..02826b3a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -85,7 +85,7 @@ jobs: (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main' || env.GITHUB_BRANCH == 'release') uses: elgohr/Publish-Docker-Github-Action@3.04 with: - dockerfile: rabbitmq/autophrase/Dockerfile + dockerfile: ./rabbitmq/autophrase/Dockerfile context: ./rabbitmq/autophrase name: ${{ matrix.docker_location }} no_push: true From 28701aa4a63b3bfa730d7b17d054d85207af1684 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 14:17:56 -0600 Subject: [PATCH 34/75] Update docker.yml --- .github/workflows/docker.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 02826b3a..82f5bc36 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -83,12 +83,10 @@ jobs: if: | github.repository == env.MAIN_REPO && (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main' || env.GITHUB_BRANCH == 'release') - uses: elgohr/Publish-Docker-Github-Action@3.04 - with: - dockerfile: ./rabbitmq/autophrase/Dockerfile - context: ./rabbitmq/autophrase - name: ${{ matrix.docker_location }} - no_push: true + run: | + docker build -t ${{ matrix.docker_location }} ./rabbitmq/autophrase + env: + matrix.docker_location: socialmediamacroscope/autophrase - name: Publish docker image to Docker hub if: | From abdfde7982d01d5f4eced33e8df4d26b9e6487f0 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 14:19:26 -0600 Subject: [PATCH 35/75] Update docker.yml --- .github/workflows/docker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 82f5bc36..cc4f5d31 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -84,9 +84,9 @@ jobs: github.repository == env.MAIN_REPO && (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main' || env.GITHUB_BRANCH == 'release') run: | - docker build -t ${{ matrix.docker_location }} ./rabbitmq/autophrase - env: - matrix.docker_location: socialmediamacroscope/autophrase + cd rabbitmq/autophrase + docker build -t socialmediamacroscope/autophrase . + working-directory: ${{ github.workspace }} - name: Publish docker image to Docker hub if: | From 2d60a34d0bbbf369b78b799047b27900287b77ab Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 14:25:06 -0600 Subject: [PATCH 36/75] moved dockerfile to root directory --- .github/workflows/docker.yml | 13 ++++++------- Dockerfile.autophrase | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 Dockerfile.autophrase diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index cc4f5d31..8dbb2af9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -29,8 +29,7 @@ jobs: - autophrase include: - name: autophrase - dockerfile: rabbitmq/autophrase/Dockerfile - work_dir: standalone-smm-analytics/standalone-smm-analytics + dockerfile: Dockerfile.autophrase docker_location: socialmediamacroscope/autophrase steps: @@ -78,15 +77,15 @@ jobs: - name: Print current working directory run: pwd - - name: Build docker image if: | github.repository == env.MAIN_REPO && (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main' || env.GITHUB_BRANCH == 'release') - run: | - cd rabbitmq/autophrase - docker build -t socialmediamacroscope/autophrase . - working-directory: ${{ github.workspace }} + uses: elgohr/Publish-Docker-Github-Action@3.04 + with: + dockerfile: ${{ matrix.dockerfile }} + name: ${{ matrix.hub_project }} + no_push: true - name: Publish docker image to Docker hub if: | diff --git a/Dockerfile.autophrase b/Dockerfile.autophrase new file mode 100644 index 00000000..8b8a9c5b --- /dev/null +++ b/Dockerfile.autophrase @@ -0,0 +1,23 @@ +FROM ubuntu:18.04 + +# git clone autophrase algorithm +RUN apt-get update \ +&& apt-get -y install git && apt-get -y install cron \ +&& cd / && git clone https://github.com/IllinoisSocialMediaMacroscope/SMILE-AutoPhrase.git AutoPhrase + +# overwrite +WORKDIR /AutoPhrase +COPY ./rabbitmq/autophrase ./ + +ENV RABBITMQ_HOST="rabbitmq" + +# install dependency libraries +RUN apt-get -y update \ +&& apt-get -y install g++ openjdk-8-jdk curl python3-pip \ +&& pip3 install -r requirement.txt \ +# switch work directory to be AutoPhrase +&& /bin/bash -c "source compile.sh" \ +# cron job clean tmp folder +&& chmod u+x ./clear_cache.sh \ +&& chmod 0644 ./clear_cache_cron \ +&& crontab ./clear_cache_cron From 9a0b6a9fa00f8ef3d44aaecb01373650f2cbc4e5 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 14:28:40 -0600 Subject: [PATCH 37/75] fixed indentation --- .github/workflows/docker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8dbb2af9..74bb1a9c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -83,9 +83,9 @@ jobs: (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main' || env.GITHUB_BRANCH == 'release') uses: elgohr/Publish-Docker-Github-Action@3.04 with: - dockerfile: ${{ matrix.dockerfile }} - name: ${{ matrix.hub_project }} - no_push: true + dockerfile: ${{ matrix.dockerfile }} + name: ${{ matrix.hub_project }} + no_push: true - name: Publish docker image to Docker hub if: | From b2bee7ed2ac4fad0362e4285d9afb7ee0d5c4d6e Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 14:32:11 -0600 Subject: [PATCH 38/75] fixed name --- .github/workflows/docker.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 74bb1a9c..74fdc473 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -20,7 +20,6 @@ env: jobs: docker: - name: Build and Push Docker runs-on: ubuntu-latest strategy: fail-fast: true From bb69b58d9862fe7b9f02f8c52a5d63cec62c9a2a Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 14:38:27 -0600 Subject: [PATCH 39/75] redo from beginning --- .github/workflows/docker.yml | 256 ++++++++++++++++++++++++----------- 1 file changed, 177 insertions(+), 79 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 74fdc473..d1368586 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,103 +1,201 @@ -name: Docker - -# TODO: post an alert to incore-alerts slack channel when there is a failure on develop or main branches +ame: CI on: push: branches: - main -# - develop -# - 'release/*' + - develop + - 'release/*' + + tags: + - '*' pull_request: - branches: - - main -# - develop -# - 'release/*' env: MAIN_REPO: ncsa/standalone-smm-analytics jobs: + + # ---------------------------------------------------------------------- + # DOCKER BUILD + # ---------------------------------------------------------------------- docker: runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - name: - - autophrase - include: - - name: autophrase - dockerfile: Dockerfile.autophrase - docker_location: socialmediamacroscope/autophrase steps: - - name: version information and set envs - run: | - if [ "${{ github.event.release.target_commitish }}" != "" ]; then - BRANCH="${{ github.event.release.target_commitish }}" - elif [[ "${{github.event_name}}" == "pull_request" ]]; then - BRANCH="PR-${{github.event.pull_request.number}}" - else - if [[ $GITHUB_REF =~ "release/" ]]; then - BRANCH="release" - else - BRANCH=${GITHUB_REF##*/} - fi - fi + # checkout source code + - uses: actions/checkout@v2 - echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV - version=$(cat ./server/build.gradle | grep "archiveVersion" | head -1 | awk -F= "{ print $2 }" | sed "s/[archiveVersion =,',]//g") - if [ "$BRANCH" == "main" ]; then - tags="latest" - oldversion="" - while [ "${oldversion}" != "${version}" ]; do - oldversion="${version}" - tags="${tags},${version}" - version=${version%.*} - done - echo "VERSION=${version}" >> $GITHUB_ENV - echo "TAGS=${tags}" >> $GITHUB_ENV - elif [ "$BRANCH" == "release" ]; then - echo "VERSION=${version}-rc" >> $GITHUB_ENV - echo "TAGS=${version}-rc" >> $GITHUB_ENV - elif [ "$BRANCH" == "develop" ]; then - echo "VERSION=develop" >> $GITHUB_ENV - echo "TAGS=develop" >> $GITHUB_ENV - else - echo "VERSION=testing" >> $GITHUB_ENV - STRIPPED_TAGS=${BRANCH/\#/_} - echo "TAGS=${STRIPPED_TAGS}" >> $GITHUB_ENV - fi + # calculate some variables that are used later + - name: version information + run: | + if [ "${{ github.event.release.target_commitish }}" != "" ]; then + BRANCH="${{ github.event.release.target_commitish }}" + elif [[ "${{github.event_name}}" == "pull_request" ]]; then + BRANCH="PR-${{github.event.pull_request.number}}" + else + BRANCH=${GITHUB_REF##*/} + fi + echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV - - name: Debug directory contents - run: ls -R + if [ "$BRANCH" == "main" ]; then + VERSION=$(cat manual_jb/content/_config.yml | grep "version" | head -1 | awk -F= "{print $2 }" | sed "s/[[:alpha:]|,|-|\"|:|#|[:space:]]//g" | sed "s/-//g") + VERSIONS="latest" + OLDVERSION="" + TMPVERSION=$VERSION + while [ "$OLDVERSION" != "$TMPVERSION" ]; do + VERSIONS="${VERSIONS} ${TMPVERSION}" + OLDVERSION="${TMPVERSION}" + TMPVERSION=$(echo ${OLDVERSION} | sed 's/\.[0-9]*$//') + done + echo "DOC_VERSION=$VERSION" >> $GITHUB_ENV + echo "DOC_TAGS=${VERSIONS}" >> $GITHUB_ENV - - name: Print current working directory - run: pwd + # Swagger API Version + VERSION=$(cat restapi/data.json | grep \"version\" | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,",]//g' | tr -d '[[:space:]]') + VERSIONS="latest" + OLDVERSION="" + TMPVERSION=$VERSION + while [ "$OLDVERSION" != "$TMPVERSION" ]; do + VERSIONS="${VERSIONS} ${TMPVERSION}" + OLDVERSION="${TMPVERSION}" + TMPVERSION=$(echo ${OLDVERSION} | sed 's/\.[0-9]*$//') + done + echo "API_VERSION=${VERSION}" >> $GITHUB_ENV + echo "API_TAGS=${VERSIONS}" >> $GITHUB_ENV + elif [ "$BRANCH" == "develop" ]; then + echo "DOC_VERSION=develop" >> $GITHUB_ENV + echo "API_VERSION=develop" >> $GITHUB_ENV + echo "DOC_TAGS=develop" >> $GITHUB_ENV + echo "API_TAGS=develop" >> $GITHUB_ENV + else + echo "DOC_VERSION=testing" >> $GITHUB_ENV + echo "API_VERSION=testing" >> $GITHUB_ENV + echo "DOC_TAGS=${BRANCH}" >> $GITHUB_ENV + echo "API_TAGS=${BRANCH}" >> $GITHUB_ENV + fi - - name: Build docker image - if: | - github.repository == env.MAIN_REPO && - (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main' || env.GITHUB_BRANCH == 'release') - uses: elgohr/Publish-Docker-Github-Action@3.04 - with: - dockerfile: ${{ matrix.dockerfile }} - name: ${{ matrix.hub_project }} - no_push: true + # build image incore/doc/incore + - name: Build doc image + uses: elgohr/Publish-Docker-Github-Action@3.04 + with: + name: socialmediamacroscope/autophrase + no_push: true + workdir: rabbitmq/autophrase + # this will publish to NCSA image incore/doc/incore +# - name: Publish doc image to NCSA Hub +# #if: github.event_name != 'pull_request' && github.repository == env.MAIN_REPO +# if: github.repository == env.MAIN_REPO +# uses: elgohr/Publish-Docker-Github-Action@3.04 +# with: +# registry: hub.ncsa.illinois.edu +# name: incore/doc/incore +# username: ${{ secrets.HUB_USERNAME }} +# password: ${{ secrets.HUB_PASSWORD }} +# tags: "${{ env.DOC_TAGS }}" +# workdir: manual_jb - - name: Publish docker image to Docker hub - if: | - github.repository == env.MAIN_REPO && - (github.event_name == env.GITHUB_BRANCH == 'main') - uses: elgohr/Publish-Docker-Github-Action@3.04 - with: - dockerfile: ${{ matrix.dockerfile }} - registry: hub.docker.com - name: ${{ matrix.docker_location }} - username: ${{ secrets.HUB_USERNAME }} - password: ${{ secrets.HUB_PASSWORD }} - tags: "${{ env.TAGS }}" +#name: Docker +# +## TODO: post an alert to incore-alerts slack channel when there is a failure on develop or main branches +# +#on: +# push: +# branches: +# - main +## - develop +## - 'release/*' +# +# pull_request: +# branches: +# - main +## - develop +## - 'release/*' +# +#env: +# MAIN_REPO: ncsa/standalone-smm-analytics +# +#jobs: +# docker: +# runs-on: ubuntu-latest +# strategy: +# fail-fast: true +# matrix: +# name: +# - autophrase +# include: +# - name: autophrase +# dockerfile: Dockerfile.autophrase +# docker_location: socialmediamacroscope/autophrase +# +# steps: +# - name: version information and set envs +# run: | +# if [ "${{ github.event.release.target_commitish }}" != "" ]; then +# BRANCH="${{ github.event.release.target_commitish }}" +# elif [[ "${{github.event_name}}" == "pull_request" ]]; then +# BRANCH="PR-${{github.event.pull_request.number}}" +# else +# if [[ $GITHUB_REF =~ "release/" ]]; then +# BRANCH="release" +# else +# BRANCH=${GITHUB_REF##*/} +# fi +# fi +# +# echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV +# version=$(cat ./server/build.gradle | grep "archiveVersion" | head -1 | awk -F= "{ print $2 }" | sed "s/[archiveVersion =,',]//g") +# if [ "$BRANCH" == "main" ]; then +# tags="latest" +# oldversion="" +# while [ "${oldversion}" != "${version}" ]; do +# oldversion="${version}" +# tags="${tags},${version}" +# version=${version%.*} +# done +# echo "VERSION=${version}" >> $GITHUB_ENV +# echo "TAGS=${tags}" >> $GITHUB_ENV +# elif [ "$BRANCH" == "release" ]; then +# echo "VERSION=${version}-rc" >> $GITHUB_ENV +# echo "TAGS=${version}-rc" >> $GITHUB_ENV +# elif [ "$BRANCH" == "develop" ]; then +# echo "VERSION=develop" >> $GITHUB_ENV +# echo "TAGS=develop" >> $GITHUB_ENV +# else +# echo "VERSION=testing" >> $GITHUB_ENV +# STRIPPED_TAGS=${BRANCH/\#/_} +# echo "TAGS=${STRIPPED_TAGS}" >> $GITHUB_ENV +# fi +# +# - name: Debug directory contents +# run: ls -R +# +# - name: Print current working directory +# run: pwd +# +# - name: Build docker image +# if: | +# github.repository == env.MAIN_REPO && +# (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main' || env.GITHUB_BRANCH == 'release') +# uses: elgohr/Publish-Docker-Github-Action@3.04 +# with: +# dockerfile: ${{ matrix.dockerfile }} +# name: ${{ matrix.hub_project }} +# no_push: true +# +# - name: Publish docker image to Docker hub +# if: | +# github.repository == env.MAIN_REPO && +# (github.event_name == env.GITHUB_BRANCH == 'main') +# uses: elgohr/Publish-Docker-Github-Action@3.04 +# with: +# dockerfile: ${{ matrix.dockerfile }} +# registry: hub.docker.com +# name: ${{ matrix.docker_location }} +# username: ${{ secrets.HUB_USERNAME }} +# password: ${{ secrets.HUB_PASSWORD }} +# tags: "${{ env.TAGS }}" # # # ---------------------------------------------------------------------- # # DOCKER BUILD From d272d52d64421300720c55d7671d1dbd043167ea Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 14:39:33 -0600 Subject: [PATCH 40/75] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d1368586..1581e79b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,4 +1,4 @@ -ame: CI +name: CI on: push: From f256642f698e3d9cfa7d500faeaf2b27390d6001 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 14:46:20 -0600 Subject: [PATCH 41/75] changed to matrix --- .github/workflows/docker.yml | 152 +++++++++++++++++++---------------- 1 file changed, 81 insertions(+), 71 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d1368586..e2d93245 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -22,79 +22,89 @@ jobs: # ---------------------------------------------------------------------- docker: runs-on: ubuntu-latest + strategy: + fail-fast: + matrix: + name: + - autophrase + include: + - name: autophrase + dockerfile: Dockerfile + workdir: rabbitmq/autophrase + hub_project: socialmediamacroscope/autophrase + steps: + # checkout source code + - uses: actions/checkout@v2 - steps: - # checkout source code - - uses: actions/checkout@v2 + # calculate some variables that are used later + - name: version information + run: | + if [ "${{ github.event.release.target_commitish }}" != "" ]; then + BRANCH="${{ github.event.release.target_commitish }}" + elif [[ "${{github.event_name}}" == "pull_request" ]]; then + BRANCH="PR-${{github.event.pull_request.number}}" + else + BRANCH=${GITHUB_REF##*/} + fi + echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV + + if [ "$BRANCH" == "main" ]; then + VERSION=$(cat manual_jb/content/_config.yml | grep "version" | head -1 | awk -F= "{print $2 }" | sed "s/[[:alpha:]|,|-|\"|:|#|[:space:]]//g" | sed "s/-//g") + VERSIONS="latest" + OLDVERSION="" + TMPVERSION=$VERSION + while [ "$OLDVERSION" != "$TMPVERSION" ]; do + VERSIONS="${VERSIONS} ${TMPVERSION}" + OLDVERSION="${TMPVERSION}" + TMPVERSION=$(echo ${OLDVERSION} | sed 's/\.[0-9]*$//') + done + echo "DOC_VERSION=$VERSION" >> $GITHUB_ENV + echo "DOC_TAGS=${VERSIONS}" >> $GITHUB_ENV + + # Swagger API Version + VERSION=$(cat restapi/data.json | grep \"version\" | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,",]//g' | tr -d '[[:space:]]') + VERSIONS="latest" + OLDVERSION="" + TMPVERSION=$VERSION + while [ "$OLDVERSION" != "$TMPVERSION" ]; do + VERSIONS="${VERSIONS} ${TMPVERSION}" + OLDVERSION="${TMPVERSION}" + TMPVERSION=$(echo ${OLDVERSION} | sed 's/\.[0-9]*$//') + done + echo "API_VERSION=${VERSION}" >> $GITHUB_ENV + echo "API_TAGS=${VERSIONS}" >> $GITHUB_ENV + elif [ "$BRANCH" == "develop" ]; then + echo "DOC_VERSION=develop" >> $GITHUB_ENV + echo "API_VERSION=develop" >> $GITHUB_ENV + echo "DOC_TAGS=develop" >> $GITHUB_ENV + echo "API_TAGS=develop" >> $GITHUB_ENV + else + echo "DOC_VERSION=testing" >> $GITHUB_ENV + echo "API_VERSION=testing" >> $GITHUB_ENV + echo "DOC_TAGS=${BRANCH}" >> $GITHUB_ENV + echo "API_TAGS=${BRANCH}" >> $GITHUB_ENV + fi - # calculate some variables that are used later - - name: version information - run: | - if [ "${{ github.event.release.target_commitish }}" != "" ]; then - BRANCH="${{ github.event.release.target_commitish }}" - elif [[ "${{github.event_name}}" == "pull_request" ]]; then - BRANCH="PR-${{github.event.pull_request.number}}" - else - BRANCH=${GITHUB_REF##*/} - fi - echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV - - if [ "$BRANCH" == "main" ]; then - VERSION=$(cat manual_jb/content/_config.yml | grep "version" | head -1 | awk -F= "{print $2 }" | sed "s/[[:alpha:]|,|-|\"|:|#|[:space:]]//g" | sed "s/-//g") - VERSIONS="latest" - OLDVERSION="" - TMPVERSION=$VERSION - while [ "$OLDVERSION" != "$TMPVERSION" ]; do - VERSIONS="${VERSIONS} ${TMPVERSION}" - OLDVERSION="${TMPVERSION}" - TMPVERSION=$(echo ${OLDVERSION} | sed 's/\.[0-9]*$//') - done - echo "DOC_VERSION=$VERSION" >> $GITHUB_ENV - echo "DOC_TAGS=${VERSIONS}" >> $GITHUB_ENV - - # Swagger API Version - VERSION=$(cat restapi/data.json | grep \"version\" | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,",]//g' | tr -d '[[:space:]]') - VERSIONS="latest" - OLDVERSION="" - TMPVERSION=$VERSION - while [ "$OLDVERSION" != "$TMPVERSION" ]; do - VERSIONS="${VERSIONS} ${TMPVERSION}" - OLDVERSION="${TMPVERSION}" - TMPVERSION=$(echo ${OLDVERSION} | sed 's/\.[0-9]*$//') - done - echo "API_VERSION=${VERSION}" >> $GITHUB_ENV - echo "API_TAGS=${VERSIONS}" >> $GITHUB_ENV - elif [ "$BRANCH" == "develop" ]; then - echo "DOC_VERSION=develop" >> $GITHUB_ENV - echo "API_VERSION=develop" >> $GITHUB_ENV - echo "DOC_TAGS=develop" >> $GITHUB_ENV - echo "API_TAGS=develop" >> $GITHUB_ENV - else - echo "DOC_VERSION=testing" >> $GITHUB_ENV - echo "API_VERSION=testing" >> $GITHUB_ENV - echo "DOC_TAGS=${BRANCH}" >> $GITHUB_ENV - echo "API_TAGS=${BRANCH}" >> $GITHUB_ENV - fi - - # build image incore/doc/incore - - name: Build doc image - uses: elgohr/Publish-Docker-Github-Action@3.04 - with: - name: socialmediamacroscope/autophrase - no_push: true - workdir: rabbitmq/autophrase - # this will publish to NCSA image incore/doc/incore -# - name: Publish doc image to NCSA Hub -# #if: github.event_name != 'pull_request' && github.repository == env.MAIN_REPO -# if: github.repository == env.MAIN_REPO -# uses: elgohr/Publish-Docker-Github-Action@3.04 -# with: -# registry: hub.ncsa.illinois.edu -# name: incore/doc/incore -# username: ${{ secrets.HUB_USERNAME }} -# password: ${{ secrets.HUB_PASSWORD }} -# tags: "${{ env.DOC_TAGS }}" -# workdir: manual_jb + # build image incore/doc/incore + - name: Build doc image + uses: elgohr/Publish-Docker-Github-Action@3.04 + with: + dockerfile: ${{ matrix.dockerfile }} + name: ${{ matrix.hub_project }} + no_push: true + workdir: ${{ matrix.workdir }} + # this will publish to NCSA image incore/doc/incore + # - name: Publish doc image to NCSA Hub + # #if: github.event_name != 'pull_request' && github.repository == env.MAIN_REPO + # if: github.repository == env.MAIN_REPO + # uses: elgohr/Publish-Docker-Github-Action@3.04 + # with: + # registry: hub.ncsa.illinois.edu + # name: incore/doc/incore + # username: ${{ secrets.HUB_USERNAME }} + # password: ${{ secrets.HUB_PASSWORD }} + # tags: "${{ env.DOC_TAGS }}" + # workdir: manual_jb #name: Docker # From ffc4e9488b3966aa1207bc696fc535795d4b1e8d Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 14:48:41 -0600 Subject: [PATCH 42/75] fixed indentation --- .github/workflows/docker.yml | 142 +++++++++++++++++------------------ 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4a3a2189..e994a6a6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -32,79 +32,79 @@ jobs: dockerfile: Dockerfile workdir: rabbitmq/autophrase hub_project: socialmediamacroscope/autophrase - steps: - # checkout source code - - uses: actions/checkout@v2 + steps: + # checkout source code + - uses: actions/checkout@v2 - # calculate some variables that are used later - - name: version information - run: | - if [ "${{ github.event.release.target_commitish }}" != "" ]; then - BRANCH="${{ github.event.release.target_commitish }}" - elif [[ "${{github.event_name}}" == "pull_request" ]]; then - BRANCH="PR-${{github.event.pull_request.number}}" - else - BRANCH=${GITHUB_REF##*/} - fi - echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV - - if [ "$BRANCH" == "main" ]; then - VERSION=$(cat manual_jb/content/_config.yml | grep "version" | head -1 | awk -F= "{print $2 }" | sed "s/[[:alpha:]|,|-|\"|:|#|[:space:]]//g" | sed "s/-//g") - VERSIONS="latest" - OLDVERSION="" - TMPVERSION=$VERSION - while [ "$OLDVERSION" != "$TMPVERSION" ]; do - VERSIONS="${VERSIONS} ${TMPVERSION}" - OLDVERSION="${TMPVERSION}" - TMPVERSION=$(echo ${OLDVERSION} | sed 's/\.[0-9]*$//') - done - echo "DOC_VERSION=$VERSION" >> $GITHUB_ENV - echo "DOC_TAGS=${VERSIONS}" >> $GITHUB_ENV - - # Swagger API Version - VERSION=$(cat restapi/data.json | grep \"version\" | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,",]//g' | tr -d '[[:space:]]') - VERSIONS="latest" - OLDVERSION="" - TMPVERSION=$VERSION - while [ "$OLDVERSION" != "$TMPVERSION" ]; do - VERSIONS="${VERSIONS} ${TMPVERSION}" - OLDVERSION="${TMPVERSION}" - TMPVERSION=$(echo ${OLDVERSION} | sed 's/\.[0-9]*$//') - done - echo "API_VERSION=${VERSION}" >> $GITHUB_ENV - echo "API_TAGS=${VERSIONS}" >> $GITHUB_ENV - elif [ "$BRANCH" == "develop" ]; then - echo "DOC_VERSION=develop" >> $GITHUB_ENV - echo "API_VERSION=develop" >> $GITHUB_ENV - echo "DOC_TAGS=develop" >> $GITHUB_ENV - echo "API_TAGS=develop" >> $GITHUB_ENV - else - echo "DOC_VERSION=testing" >> $GITHUB_ENV - echo "API_VERSION=testing" >> $GITHUB_ENV - echo "DOC_TAGS=${BRANCH}" >> $GITHUB_ENV - echo "API_TAGS=${BRANCH}" >> $GITHUB_ENV - fi + # calculate some variables that are used later + - name: version information + run: | + if [ "${{ github.event.release.target_commitish }}" != "" ]; then + BRANCH="${{ github.event.release.target_commitish }}" + elif [[ "${{github.event_name}}" == "pull_request" ]]; then + BRANCH="PR-${{github.event.pull_request.number}}" + else + BRANCH=${GITHUB_REF##*/} + fi + echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV - # build image incore/doc/incore - - name: Build doc image - uses: elgohr/Publish-Docker-Github-Action@3.04 - with: - dockerfile: ${{ matrix.dockerfile }} - name: ${{ matrix.hub_project }} - no_push: true - workdir: ${{ matrix.workdir }} - # this will publish to NCSA image incore/doc/incore - # - name: Publish doc image to NCSA Hub - # #if: github.event_name != 'pull_request' && github.repository == env.MAIN_REPO - # if: github.repository == env.MAIN_REPO - # uses: elgohr/Publish-Docker-Github-Action@3.04 - # with: - # registry: hub.ncsa.illinois.edu - # name: incore/doc/incore - # username: ${{ secrets.HUB_USERNAME }} - # password: ${{ secrets.HUB_PASSWORD }} - # tags: "${{ env.DOC_TAGS }}" - # workdir: manual_jb + if [ "$BRANCH" == "main" ]; then + VERSION=$(cat manual_jb/content/_config.yml | grep "version" | head -1 | awk -F= "{print $2 }" | sed "s/[[:alpha:]|,|-|\"|:|#|[:space:]]//g" | sed "s/-//g") + VERSIONS="latest" + OLDVERSION="" + TMPVERSION=$VERSION + while [ "$OLDVERSION" != "$TMPVERSION" ]; do + VERSIONS="${VERSIONS} ${TMPVERSION}" + OLDVERSION="${TMPVERSION}" + TMPVERSION=$(echo ${OLDVERSION} | sed 's/\.[0-9]*$//') + done + echo "DOC_VERSION=$VERSION" >> $GITHUB_ENV + echo "DOC_TAGS=${VERSIONS}" >> $GITHUB_ENV + + # Swagger API Version + VERSION=$(cat restapi/data.json | grep \"version\" | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,",]//g' | tr -d '[[:space:]]') + VERSIONS="latest" + OLDVERSION="" + TMPVERSION=$VERSION + while [ "$OLDVERSION" != "$TMPVERSION" ]; do + VERSIONS="${VERSIONS} ${TMPVERSION}" + OLDVERSION="${TMPVERSION}" + TMPVERSION=$(echo ${OLDVERSION} | sed 's/\.[0-9]*$//') + done + echo "API_VERSION=${VERSION}" >> $GITHUB_ENV + echo "API_TAGS=${VERSIONS}" >> $GITHUB_ENV + elif [ "$BRANCH" == "develop" ]; then + echo "DOC_VERSION=develop" >> $GITHUB_ENV + echo "API_VERSION=develop" >> $GITHUB_ENV + echo "DOC_TAGS=develop" >> $GITHUB_ENV + echo "API_TAGS=develop" >> $GITHUB_ENV + else + echo "DOC_VERSION=testing" >> $GITHUB_ENV + echo "API_VERSION=testing" >> $GITHUB_ENV + echo "DOC_TAGS=${BRANCH}" >> $GITHUB_ENV + echo "API_TAGS=${BRANCH}" >> $GITHUB_ENV + fi + + # build image incore/doc/incore + - name: Build doc image + uses: elgohr/Publish-Docker-Github-Action@3.04 + with: + dockerfile: ${{ matrix.dockerfile }} + name: ${{ matrix.hub_project }} + no_push: true + workdir: ${{ matrix.workdir }} + # this will publish to NCSA image incore/doc/incore +# - name: Publish doc image to NCSA Hub +# #if: github.event_name != 'pull_request' && github.repository == env.MAIN_REPO +# if: github.repository == env.MAIN_REPO +# uses: elgohr/Publish-Docker-Github-Action@3.04 +# with: +# registry: hub.ncsa.illinois.edu +# name: incore/doc/incore +# username: ${{ secrets.HUB_USERNAME }} +# password: ${{ secrets.HUB_PASSWORD }} +# tags: "${{ env.DOC_TAGS }}" +# workdir: manual_jb #name: Docker # From 4f2f9b5cb370ec7e2edfc95d78d1c4b389e52971 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 14:50:04 -0600 Subject: [PATCH 43/75] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e994a6a6..d4939ff3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -23,7 +23,7 @@ jobs: docker: runs-on: ubuntu-latest strategy: - fail-fast: + fail-fast: true matrix: name: - autophrase From 012428c12bdc22d75e7c8b45781e0b6ff4acc78f Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 14:57:06 -0600 Subject: [PATCH 44/75] added publish routine --- .github/workflows/docker.yml | 203 +++++------------------------------ Dockerfile.autophrase | 23 ---- 2 files changed, 25 insertions(+), 201 deletions(-) delete mode 100644 Dockerfile.autophrase diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e994a6a6..830cb500 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -85,188 +85,35 @@ jobs: echo "API_TAGS=${BRANCH}" >> $GITHUB_ENV fi - # build image incore/doc/incore - - name: Build doc image + - name: Build docker image uses: elgohr/Publish-Docker-Github-Action@3.04 with: dockerfile: ${{ matrix.dockerfile }} name: ${{ matrix.hub_project }} no_push: true workdir: ${{ matrix.workdir }} - # this will publish to NCSA image incore/doc/incore -# - name: Publish doc image to NCSA Hub -# #if: github.event_name != 'pull_request' && github.repository == env.MAIN_REPO -# if: github.repository == env.MAIN_REPO -# uses: elgohr/Publish-Docker-Github-Action@3.04 -# with: -# registry: hub.ncsa.illinois.edu -# name: incore/doc/incore -# username: ${{ secrets.HUB_USERNAME }} -# password: ${{ secrets.HUB_PASSWORD }} -# tags: "${{ env.DOC_TAGS }}" -# workdir: manual_jb -#name: Docker -# -## TODO: post an alert to incore-alerts slack channel when there is a failure on develop or main branches -# -#on: -# push: -# branches: -# - main -## - develop -## - 'release/*' -# -# pull_request: -# branches: -# - main -## - develop -## - 'release/*' -# -#env: -# MAIN_REPO: ncsa/standalone-smm-analytics -# -#jobs: -# docker: -# runs-on: ubuntu-latest -# strategy: -# fail-fast: true -# matrix: -# name: -# - autophrase -# include: -# - name: autophrase -# dockerfile: Dockerfile.autophrase -# docker_location: socialmediamacroscope/autophrase -# -# steps: -# - name: version information and set envs -# run: | -# if [ "${{ github.event.release.target_commitish }}" != "" ]; then -# BRANCH="${{ github.event.release.target_commitish }}" -# elif [[ "${{github.event_name}}" == "pull_request" ]]; then -# BRANCH="PR-${{github.event.pull_request.number}}" -# else -# if [[ $GITHUB_REF =~ "release/" ]]; then -# BRANCH="release" -# else -# BRANCH=${GITHUB_REF##*/} -# fi -# fi -# -# echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV -# version=$(cat ./server/build.gradle | grep "archiveVersion" | head -1 | awk -F= "{ print $2 }" | sed "s/[archiveVersion =,',]//g") -# if [ "$BRANCH" == "main" ]; then -# tags="latest" -# oldversion="" -# while [ "${oldversion}" != "${version}" ]; do -# oldversion="${version}" -# tags="${tags},${version}" -# version=${version%.*} -# done -# echo "VERSION=${version}" >> $GITHUB_ENV -# echo "TAGS=${tags}" >> $GITHUB_ENV -# elif [ "$BRANCH" == "release" ]; then -# echo "VERSION=${version}-rc" >> $GITHUB_ENV -# echo "TAGS=${version}-rc" >> $GITHUB_ENV -# elif [ "$BRANCH" == "develop" ]; then -# echo "VERSION=develop" >> $GITHUB_ENV -# echo "TAGS=develop" >> $GITHUB_ENV -# else -# echo "VERSION=testing" >> $GITHUB_ENV -# STRIPPED_TAGS=${BRANCH/\#/_} -# echo "TAGS=${STRIPPED_TAGS}" >> $GITHUB_ENV -# fi -# -# - name: Debug directory contents -# run: ls -R -# -# - name: Print current working directory -# run: pwd -# -# - name: Build docker image -# if: | -# github.repository == env.MAIN_REPO && -# (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main' || env.GITHUB_BRANCH == 'release') -# uses: elgohr/Publish-Docker-Github-Action@3.04 -# with: -# dockerfile: ${{ matrix.dockerfile }} -# name: ${{ matrix.hub_project }} -# no_push: true -# -# - name: Publish docker image to Docker hub -# if: | -# github.repository == env.MAIN_REPO && -# (github.event_name == env.GITHUB_BRANCH == 'main') -# uses: elgohr/Publish-Docker-Github-Action@3.04 -# with: -# dockerfile: ${{ matrix.dockerfile }} -# registry: hub.docker.com -# name: ${{ matrix.docker_location }} -# username: ${{ secrets.HUB_USERNAME }} -# password: ${{ secrets.HUB_PASSWORD }} -# tags: "${{ env.TAGS }}" -# -# # ---------------------------------------------------------------------- -# # DOCKER BUILD -# # ---------------------------------------------------------------------- -# docker: -# runs-on: ubuntu-latest -# -# steps: -# # checkout source code -# - uses: actions/checkout@v2 -# -# # calculate some variables that are used later -# - name: version information -# run: | -# if [ "${{ github.event.release.target_commitish }}" != "" ]; then -# BRANCH="${{ github.event.release.target_commitish }}" -# elif [[ $GITHUB_REF =~ pull ]]; then -# BRANCH="$(echo $GITHUB_REF | sed 's#refs/pull/\([0-9]*\)/merge#PR-\1#')" -# else -# BRANCH=${GITHUB_REF##*/} -# fi -# echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV -# if [ "$BRANCH" == "main" ]; then -# version=$(cat package.json | grep \"version\" | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,",]//g' | tr -d '[[:space:]]') -# tags="latest" -# oldversion="" -# while [ "${oldversion}" != "${version}" ]; do -# oldversion="${version}" -# tags="${tags},${version}" -# version=${version%.*} -# done -# echo "VERSION=${version}" >> $GITHUB_ENV -# echo "TAGS=${tags}" >> $GITHUB_ENV -# elif [ "$BRANCH" == "develop" ]; then -# echo "VERSION=develop" >> $GITHUB_ENV -# echo "TAGS=develop" >> $GITHUB_ENV -# else -# echo "VERSION=testing" >> $GITHUB_ENV -# echo "TAGS=${BRANCH}" >> $GITHUB_ENV -# fi -# -# - name: Build docker image -# if: | -# github.repository == env.MAIN_REPO && -## (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main' || env.GITHUB_BRANCH == 'release') -# (github.event_name == 'env.GITHUB_BRANCH == 'pull_request') -# uses: elgohr/Publish-Docker-Github-Action@3.04 -# with: -# dockerfile: ${{ matrix.dockerfile }} -# name: ${{ matrix.hub_project }} -# no_push: true -# -## - name: Publish docker image to NCSA hub -## if: | -## github.repository == env.MAIN_REPO && -## (github.event_name == 'pull_request' || env.GITHUB_BRANCH == 'develop' || env.GITHUB_BRANCH == 'main'|| env.GITHUB_BRANCH == 'release') -## uses: elgohr/Publish-Docker-Github-Action@3.04 -## with: -## dockerfile: ${{ matrix.dockerfile }} -## registry: hub.ncsa.illinois.edu -## name: ${{ matrix.hub_project }} -## username: ${{ secrets.HUB_USERNAME }} -## password: ${{ secrets.HUB_PASSWORD }} -## tags: "${{ env.TAGS }}" + - name: Publish docker image to Docker hub + if: | + github.repository == env.MAIN_REPO && + (github.event_name == env.GITHUB_BRANCH == 'main') + uses: elgohr/Publish-Docker-Github-Action@3.04 + with: + dockerfile: ${{ matrix.dockerfile }} + registry: hub.docker.com + name: ${{ matrix.hub_project }} + username: ${{ secrets.HUB_USERNAME }} + password: ${{ secrets.HUB_PASSWORD }} + tags: "${{ env.TAGS }}" + + - name: Publish doc image to Docker Hub + #if: github.event_name != 'pull_request' && github.repository == env.MAIN_REPO + if: github.repository == env.MAIN_REPO + uses: elgohr/Publish-Docker-Github-Action@3.04 + with: + registry: hub.docker.com + name: ${{ matrix.hub_project }} + username: ${{ secrets.HUB_USERNAME }} + password: ${{ secrets.HUB_PASSWORD }} + tags: "${{ env.DOC_TAGS }}" + workdir: ${{ matrix.workdir }} diff --git a/Dockerfile.autophrase b/Dockerfile.autophrase deleted file mode 100644 index 8b8a9c5b..00000000 --- a/Dockerfile.autophrase +++ /dev/null @@ -1,23 +0,0 @@ -FROM ubuntu:18.04 - -# git clone autophrase algorithm -RUN apt-get update \ -&& apt-get -y install git && apt-get -y install cron \ -&& cd / && git clone https://github.com/IllinoisSocialMediaMacroscope/SMILE-AutoPhrase.git AutoPhrase - -# overwrite -WORKDIR /AutoPhrase -COPY ./rabbitmq/autophrase ./ - -ENV RABBITMQ_HOST="rabbitmq" - -# install dependency libraries -RUN apt-get -y update \ -&& apt-get -y install g++ openjdk-8-jdk curl python3-pip \ -&& pip3 install -r requirement.txt \ -# switch work directory to be AutoPhrase -&& /bin/bash -c "source compile.sh" \ -# cron job clean tmp folder -&& chmod u+x ./clear_cache.sh \ -&& chmod 0644 ./clear_cache_cron \ -&& crontab ./clear_cache_cron From 1136c229b55e34341936b0ef445b2378d8cb933b Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 15:04:52 -0600 Subject: [PATCH 45/75] updated secret --- .github/workflows/docker.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index be4c7d72..caba8811 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -93,18 +93,18 @@ jobs: no_push: true workdir: ${{ matrix.workdir }} - - name: Publish docker image to Docker hub - if: | - github.repository == env.MAIN_REPO && - (github.event_name == env.GITHUB_BRANCH == 'main') - uses: elgohr/Publish-Docker-Github-Action@3.04 - with: - dockerfile: ${{ matrix.dockerfile }} - registry: hub.docker.com - name: ${{ matrix.hub_project }} - username: ${{ secrets.HUB_USERNAME }} - password: ${{ secrets.HUB_PASSWORD }} - tags: "${{ env.TAGS }}" +# - name: Publish docker image to Docker hub +# if: | +# github.repository == env.MAIN_REPO && +# (github.event_name == env.GITHUB_BRANCH == 'main') +# uses: elgohr/Publish-Docker-Github-Action@3.04 +# with: +# dockerfile: ${{ matrix.dockerfile }} +# registry: hub.docker.com +# name: ${{ matrix.hub_project }} +# username: ${{ secrets.HUB_USERNAME }} +# password: ${{ secrets.HUB_PASSWORD }} +# tags: "${{ env.TAGS }}" - name: Publish doc image to Docker Hub #if: github.event_name != 'pull_request' && github.repository == env.MAIN_REPO From f710350e77709f24ce69a50a8cbef25e9e1d7d10 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 15:09:51 -0600 Subject: [PATCH 46/75] updated docker hub registry --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index caba8811..2871fb4f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -111,7 +111,7 @@ jobs: if: github.repository == env.MAIN_REPO uses: elgohr/Publish-Docker-Github-Action@3.04 with: - registry: hub.docker.com + registry: docker.io name: ${{ matrix.hub_project }} username: ${{ secrets.HUB_USERNAME }} password: ${{ secrets.HUB_PASSWORD }} From eb0440453e9a8fb99e52cb09e697fa877b3d790d Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 15:17:51 -0600 Subject: [PATCH 47/75] added histogram to matrix --- .github/workflows/docker.yml | 49 ++++++++++-------------------------- 1 file changed, 13 insertions(+), 36 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2871fb4f..3a93d7f8 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -27,11 +27,16 @@ jobs: matrix: name: - autophrase + - histogram include: - name: autophrase dockerfile: Dockerfile workdir: rabbitmq/autophrase hub_project: socialmediamacroscope/autophrase + - name: histogram + dockerfile: Dockerfile + workdir: rabbitmq/histogram + hub_project: socialmediamacroscope/histogram steps: # checkout source code - uses: actions/checkout@v2 @@ -58,31 +63,14 @@ jobs: OLDVERSION="${TMPVERSION}" TMPVERSION=$(echo ${OLDVERSION} | sed 's/\.[0-9]*$//') done - echo "DOC_VERSION=$VERSION" >> $GITHUB_ENV - echo "DOC_TAGS=${VERSIONS}" >> $GITHUB_ENV - - # Swagger API Version - VERSION=$(cat restapi/data.json | grep \"version\" | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,",]//g' | tr -d '[[:space:]]') - VERSIONS="latest" - OLDVERSION="" - TMPVERSION=$VERSION - while [ "$OLDVERSION" != "$TMPVERSION" ]; do - VERSIONS="${VERSIONS} ${TMPVERSION}" - OLDVERSION="${TMPVERSION}" - TMPVERSION=$(echo ${OLDVERSION} | sed 's/\.[0-9]*$//') - done - echo "API_VERSION=${VERSION}" >> $GITHUB_ENV - echo "API_TAGS=${VERSIONS}" >> $GITHUB_ENV + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "TAGS=${VERSIONS}" >> $GITHUB_ENV elif [ "$BRANCH" == "develop" ]; then - echo "DOC_VERSION=develop" >> $GITHUB_ENV - echo "API_VERSION=develop" >> $GITHUB_ENV - echo "DOC_TAGS=develop" >> $GITHUB_ENV - echo "API_TAGS=develop" >> $GITHUB_ENV + echo "VERSION=develop" >> $GITHUB_ENV + echo "TAGS=develop" >> $GITHUB_ENV else - echo "DOC_VERSION=testing" >> $GITHUB_ENV - echo "API_VERSION=testing" >> $GITHUB_ENV - echo "DOC_TAGS=${BRANCH}" >> $GITHUB_ENV - echo "API_TAGS=${BRANCH}" >> $GITHUB_ENV + echo "VERSION=testing" >> $GITHUB_ENV + echo "TAGS=${BRANCH}" >> $GITHUB_ENV fi - name: Build docker image @@ -93,21 +81,10 @@ jobs: no_push: true workdir: ${{ matrix.workdir }} -# - name: Publish docker image to Docker hub + - name: Publish doc image to Docker Hub # if: | # github.repository == env.MAIN_REPO && # (github.event_name == env.GITHUB_BRANCH == 'main') -# uses: elgohr/Publish-Docker-Github-Action@3.04 -# with: -# dockerfile: ${{ matrix.dockerfile }} -# registry: hub.docker.com -# name: ${{ matrix.hub_project }} -# username: ${{ secrets.HUB_USERNAME }} -# password: ${{ secrets.HUB_PASSWORD }} -# tags: "${{ env.TAGS }}" - - - name: Publish doc image to Docker Hub - #if: github.event_name != 'pull_request' && github.repository == env.MAIN_REPO if: github.repository == env.MAIN_REPO uses: elgohr/Publish-Docker-Github-Action@3.04 with: @@ -115,5 +92,5 @@ jobs: name: ${{ matrix.hub_project }} username: ${{ secrets.HUB_USERNAME }} password: ${{ secrets.HUB_PASSWORD }} - tags: "${{ env.DOC_TAGS }}" + tags: "${{ env.TAGS }}" workdir: ${{ matrix.workdir }} From 381493e21993fa94dc4a56cdfc6e6965fce6365b Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 15:22:03 -0600 Subject: [PATCH 48/75] added version tag --- .github/workflows/docker.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 3a93d7f8..386489c6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -41,7 +41,7 @@ jobs: # checkout source code - uses: actions/checkout@v2 - # calculate some variables that are used later + # calculate version information - name: version information run: | if [ "${{ github.event.release.target_commitish }}" != "" ]; then @@ -73,6 +73,9 @@ jobs: echo "TAGS=${BRANCH}" >> $GITHUB_ENV fi + - name: Print DOC_TAGS + run: echo "Version tag value is: ${{ env.TAGS }}" + - name: Build docker image uses: elgohr/Publish-Docker-Github-Action@3.04 with: From 81f1a99a39b2dd55be5eaa0c8edd8dd2eefded51 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 15:27:14 -0600 Subject: [PATCH 49/75] Update docker.yml --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 386489c6..2d52cfcf 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -73,8 +73,8 @@ jobs: echo "TAGS=${BRANCH}" >> $GITHUB_ENV fi - - name: Print DOC_TAGS - run: echo "Version tag value is: ${{ env.TAGS }}" + - name: Print Version tag + run: echo "${{ env.TAGS }}" - name: Build docker image uses: elgohr/Publish-Docker-Github-Action@3.04 From 75530f8813d07eb437e1411caaed03757c2f8408 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 15:28:50 -0600 Subject: [PATCH 50/75] added version print --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 386489c6..07caeae9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -73,8 +73,8 @@ jobs: echo "TAGS=${BRANCH}" >> $GITHUB_ENV fi - - name: Print DOC_TAGS - run: echo "Version tag value is: ${{ env.TAGS }}" + - name: Print Version tag + run: echo "${{ env.DOC_TAGS }}" - name: Build docker image uses: elgohr/Publish-Docker-Github-Action@3.04 From 996ef389aafb6f04074f36304ca7643d324a3149 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 9 Nov 2023 15:31:25 -0600 Subject: [PATCH 51/75] made only to build and publish when it gets merged to main --- .github/workflows/docker.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2d52cfcf..4f5c42d1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -77,6 +77,9 @@ jobs: run: echo "${{ env.TAGS }}" - name: Build docker image + if: | + github.repository == env.MAIN_REPO && + (github.event_name == env.GITHUB_BRANCH == 'main') uses: elgohr/Publish-Docker-Github-Action@3.04 with: dockerfile: ${{ matrix.dockerfile }} @@ -85,10 +88,10 @@ jobs: workdir: ${{ matrix.workdir }} - name: Publish doc image to Docker Hub -# if: | -# github.repository == env.MAIN_REPO && -# (github.event_name == env.GITHUB_BRANCH == 'main') - if: github.repository == env.MAIN_REPO + if: | + github.repository == env.MAIN_REPO && + (github.event_name == env.GITHUB_BRANCH == 'main') +# if: github.repository == env.MAIN_REPO uses: elgohr/Publish-Docker-Github-Action@3.04 with: registry: docker.io From 810868fd23f3b8027c17efc953c2dcf8147bd61c Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Wed, 15 Nov 2023 15:58:05 -0600 Subject: [PATCH 52/75] testing post to github --- .github/workflows/docker.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4f5c42d1..58a66a94 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -31,11 +31,11 @@ jobs: include: - name: autophrase dockerfile: Dockerfile - workdir: rabbitmq/autophrase + workdir: containerized_analytics/smile/autophrase hub_project: socialmediamacroscope/autophrase - name: histogram dockerfile: Dockerfile - workdir: rabbitmq/histogram + workdir: containerized_analytics/smile/histogram hub_project: socialmediamacroscope/histogram steps: # checkout source code @@ -100,3 +100,17 @@ jobs: password: ${{ secrets.HUB_PASSWORD }} tags: "${{ env.TAGS }}" workdir: ${{ matrix.workdir }} + + - name: Publish doc image to Github +# if: | +# github.repository == env.MAIN_REPO && +# (github.event_name == env.GITHUB_BRANCH == 'develop') + if: github.repository == env.MAIN_REPO + uses: elgohr/Publish-Docker-Github-Action@3.04 + with: + registry: ghcr.io + name: ${{ matrix.hub_project }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + tags: "${{ env.TAGS }}" + workdir: ${{ matrix.workdir }} From 7b51b4e26d8e14dec250099165b3585ceef85f9f Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Wed, 15 Nov 2023 16:01:17 -0600 Subject: [PATCH 53/75] testing github loging --- .github/workflows/docker.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 58a66a94..1aa4d346 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -76,6 +76,14 @@ jobs: - name: Print Version tag run: echo "${{ env.TAGS }}" + # login to registries + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build docker image if: | github.repository == env.MAIN_REPO && From 3dbaeae92303b3152c1b02e53368167e5367db5c Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Mon, 4 Dec 2023 09:44:00 -0600 Subject: [PATCH 54/75] modified github image name --- .github/workflows/docker.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1aa4d346..1de59ae6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -33,10 +33,12 @@ jobs: dockerfile: Dockerfile workdir: containerized_analytics/smile/autophrase hub_project: socialmediamacroscope/autophrase + github_project: ncsa/autophrase - name: histogram dockerfile: Dockerfile workdir: containerized_analytics/smile/histogram hub_project: socialmediamacroscope/histogram + github_project: ncsa/histogram steps: # checkout source code - uses: actions/checkout@v2 @@ -117,7 +119,7 @@ jobs: uses: elgohr/Publish-Docker-Github-Action@3.04 with: registry: ghcr.io - name: ${{ matrix.hub_project }} + name: ${{ matrix.github_project }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} tags: "${{ env.TAGS }}" From e5625150470efe4a09af299aa03da426a2278b75 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Mon, 4 Dec 2023 09:56:28 -0600 Subject: [PATCH 55/75] added other containers --- .github/workflows/docker.yml | 78 ++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1de59ae6..806a5aa4 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -28,6 +28,19 @@ jobs: name: - autophrase - histogram + - check_screen_name + - classification_predict + - classification_train + - classification_split + - collect_reddit_comments + - crimson_hexagon_monitors + - image_crawler + - named_entity_recognition + - network_analysis + - preprocessing + - screen_name_prompt + - sentiment_analysis + - topic_modeling include: - name: autophrase dockerfile: Dockerfile @@ -39,6 +52,71 @@ jobs: workdir: containerized_analytics/smile/histogram hub_project: socialmediamacroscope/histogram github_project: ncsa/histogram + - name: check_screen_name + dockerfile: Dockerfile + workdir: containerized_analytics/smile/check_screen_name + hub_project: socialmediamacroscope/check_screen_name + github_project: ncsa/check_screen_name + - name: classification_predict + dockerfile: Dockerfile + workdir: containerized_analytics/smile/classification_predict + hub_project: socialmediamacroscope/classification_predict + github_project: ncsa/classification_predict + - name: classification_train + dockerfile: Dockerfile + workdir: containerized_analytics/smile/classification_train + hub_project: socialmediamacroscope/classification_train + github_project: ncsa/classification_train + - name: classification_split + dockerfile: Dockerfile + workdir: containerized_analytics/smile/classification_split + hub_project: socialmediamacroscope/classification_split + github_project: ncsa/classification_split + - name: collect_reddit_comments + dockerfile: Dockerfile + workdir: containerized_analytics/smile/collect_reddit_comments + hub_project: socialmediamacroscope/collect_reddit_comments + github_project: ncsa/collect_reddit_comments + - name: crimson_hexagon_monitors + dockerfile: Dockerfile + workdir: containerized_analytics/smile/crimson_hexagon_monitors + hub_project: socialmediamacroscope/crimson_hexagon_monitors + github_project: ncsa/crimson_hexagon_monitors + - name: image_crawler + dockerfile: Dockerfile + workdir: containerized_analytics/smile/image_crawler + hub_project: socialmediamacroscope/image_crawler + github_project: ncsa/image_crawler + - name: named_entity_recognition + dockerfile: Dockerfile + workdir: containerized_analytics/smile/named_entity_recognition + hub_project: socialmediamacroscope/named_entity_recognition + github_project: ncsa/named_entity_recognition + - name: network_analysis + dockerfile: Dockerfile + workdir: containerized_analytics/smile/network_analysis + hub_project: socialmediamacroscope/network_analysis + github_project: ncsa/network_analysis + - name: preprocessing + dockerfile: Dockerfile + workdir: containerized_analytics/smile/preprocessing + hub_project: socialmediamacroscope/preprocessing + github_project: ncsa/preprocessing + - name: screen_name_prompt + dockerfile: Dockerfile + workdir: containerized_analytics/smile/screen_name_prompt + hub_project: socialmediamacroscope/screen_name_prompt + github_project: ncsa/screen_name_prompt + - name: sentiment_analysis + dockerfile: Dockerfile + workdir: containerized_analytics/smile/sentiment_analysis + hub_project: socialmediamacroscope/sentiment_analysis + github_project: ncsa/sentiment_analysis + - name: topic_modeling + dockerfile: Dockerfile + workdir: containerized_analytics/smile/topic_modeling + hub_project: socialmediamacroscope/topic_modeling + github_project: ncsa/topic_modeling steps: # checkout source code - uses: actions/checkout@v2 From c9b488346275a38bf7bf6949e6be527933e8910b Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Mon, 4 Dec 2023 09:59:19 -0600 Subject: [PATCH 56/75] fixed container names --- .github/workflows/docker.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 806a5aa4..1e0d0369 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -32,10 +32,10 @@ jobs: - classification_predict - classification_train - classification_split - - collect_reddit_comments + - collect_reddit_comment - crimson_hexagon_monitors - image_crawler - - named_entity_recognition + - name_entity_recognition - network_analysis - preprocessing - screen_name_prompt @@ -72,11 +72,11 @@ jobs: workdir: containerized_analytics/smile/classification_split hub_project: socialmediamacroscope/classification_split github_project: ncsa/classification_split - - name: collect_reddit_comments + - name: collect_reddit_comment dockerfile: Dockerfile - workdir: containerized_analytics/smile/collect_reddit_comments - hub_project: socialmediamacroscope/collect_reddit_comments - github_project: ncsa/collect_reddit_comments + workdir: containerized_analytics/smile/collect_reddit_comment + hub_project: socialmediamacroscope/collect_reddit_comment + github_project: ncsa/collect_reddit_comment - name: crimson_hexagon_monitors dockerfile: Dockerfile workdir: containerized_analytics/smile/crimson_hexagon_monitors @@ -87,11 +87,11 @@ jobs: workdir: containerized_analytics/smile/image_crawler hub_project: socialmediamacroscope/image_crawler github_project: ncsa/image_crawler - - name: named_entity_recognition + - name: name_entity_recognition dockerfile: Dockerfile - workdir: containerized_analytics/smile/named_entity_recognition - hub_project: socialmediamacroscope/named_entity_recognition - github_project: ncsa/named_entity_recognition + workdir: containerized_analytics/smile/name_entity_recognition + hub_project: socialmediamacroscope/name_entity_recognition + github_project: ncsa/name_entity_recognition - name: network_analysis dockerfile: Dockerfile workdir: containerized_analytics/smile/network_analysis From d0962dbe4426320c8f00fb23bde34b409f660665 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Mon, 4 Dec 2023 10:38:43 -0600 Subject: [PATCH 57/75] made to make only merged to develop --- .github/workflows/docker.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1e0d0369..9a3ae35e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -190,10 +190,10 @@ jobs: workdir: ${{ matrix.workdir }} - name: Publish doc image to Github -# if: | -# github.repository == env.MAIN_REPO && -# (github.event_name == env.GITHUB_BRANCH == 'develop') - if: github.repository == env.MAIN_REPO + if: | + github.repository == env.MAIN_REPO && + (github.event_name == env.GITHUB_BRANCH == 'develop') +# if: github.repository == env.MAIN_REPO uses: elgohr/Publish-Docker-Github-Action@3.04 with: registry: ghcr.io From a0d5ea8c4efca542991f4c5242d55fd60e1fa856 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Tue, 5 Dec 2023 07:28:01 -0600 Subject: [PATCH 58/75] rename the variables --- .github/workflows/docker.yml | 68 +++++++++++++++++------------------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9a3ae35e..45159b79 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -10,8 +10,6 @@ on: tags: - '*' - pull_request: - env: MAIN_REPO: ncsa/standalone-smm-analytics @@ -45,78 +43,78 @@ jobs: - name: autophrase dockerfile: Dockerfile workdir: containerized_analytics/smile/autophrase - hub_project: socialmediamacroscope/autophrase - github_project: ncsa/autophrase + docker_repo_tag: socialmediamacroscope/autophrase + gitdocker_repo_tag: ncsa/autophrase - name: histogram dockerfile: Dockerfile workdir: containerized_analytics/smile/histogram - hub_project: socialmediamacroscope/histogram - github_project: ncsa/histogram + docker_repo_tag: socialmediamacroscope/histogram + github_repo_tag: ncsa/histogram - name: check_screen_name dockerfile: Dockerfile workdir: containerized_analytics/smile/check_screen_name - hub_project: socialmediamacroscope/check_screen_name - github_project: ncsa/check_screen_name + docker_repo_tag: socialmediamacroscope/check_screen_name + github_repo_tag: ncsa/check_screen_name - name: classification_predict dockerfile: Dockerfile workdir: containerized_analytics/smile/classification_predict - hub_project: socialmediamacroscope/classification_predict - github_project: ncsa/classification_predict + docker_repo_tag: socialmediamacroscope/classification_predict + github_repo_tag: ncsa/classification_predict - name: classification_train dockerfile: Dockerfile workdir: containerized_analytics/smile/classification_train - hub_project: socialmediamacroscope/classification_train - github_project: ncsa/classification_train + docker_repo_tag: socialmediamacroscope/classification_train + github_repo_tag: ncsa/classification_train - name: classification_split dockerfile: Dockerfile workdir: containerized_analytics/smile/classification_split - hub_project: socialmediamacroscope/classification_split - github_project: ncsa/classification_split + docker_repo_tag: socialmediamacroscope/classification_split + github_repo_tag: ncsa/classification_split - name: collect_reddit_comment dockerfile: Dockerfile workdir: containerized_analytics/smile/collect_reddit_comment - hub_project: socialmediamacroscope/collect_reddit_comment - github_project: ncsa/collect_reddit_comment + docker_repo_tag: socialmediamacroscope/collect_reddit_comment + github_repo_tag: ncsa/collect_reddit_comment - name: crimson_hexagon_monitors dockerfile: Dockerfile workdir: containerized_analytics/smile/crimson_hexagon_monitors - hub_project: socialmediamacroscope/crimson_hexagon_monitors - github_project: ncsa/crimson_hexagon_monitors + docker_repo_tag: socialmediamacroscope/crimson_hexagon_monitors + github_repo_tag: ncsa/crimson_hexagon_monitors - name: image_crawler dockerfile: Dockerfile workdir: containerized_analytics/smile/image_crawler - hub_project: socialmediamacroscope/image_crawler - github_project: ncsa/image_crawler + docker_repo_tag: socialmediamacroscope/image_crawler + github_repo_tag: ncsa/image_crawler - name: name_entity_recognition dockerfile: Dockerfile workdir: containerized_analytics/smile/name_entity_recognition - hub_project: socialmediamacroscope/name_entity_recognition - github_project: ncsa/name_entity_recognition + docker_repo_tag: socialmediamacroscope/name_entity_recognition + github_repo_tag: ncsa/name_entity_recognition - name: network_analysis dockerfile: Dockerfile workdir: containerized_analytics/smile/network_analysis - hub_project: socialmediamacroscope/network_analysis - github_project: ncsa/network_analysis + docker_repo_tag: socialmediamacroscope/network_analysis + github_repo_tag: ncsa/network_analysis - name: preprocessing dockerfile: Dockerfile workdir: containerized_analytics/smile/preprocessing - hub_project: socialmediamacroscope/preprocessing - github_project: ncsa/preprocessing + docker_repo_tag: socialmediamacroscope/preprocessing + github_repo_tag: ncsa/preprocessing - name: screen_name_prompt dockerfile: Dockerfile workdir: containerized_analytics/smile/screen_name_prompt - hub_project: socialmediamacroscope/screen_name_prompt - github_project: ncsa/screen_name_prompt + docker_repo_tag: socialmediamacroscope/screen_name_prompt + github_repo_tag: ncsa/screen_name_prompt - name: sentiment_analysis dockerfile: Dockerfile workdir: containerized_analytics/smile/sentiment_analysis - hub_project: socialmediamacroscope/sentiment_analysis - github_project: ncsa/sentiment_analysis + docker_repo_tag: socialmediamacroscope/sentiment_analysis + github_repo_tag: ncsa/sentiment_analysis - name: topic_modeling dockerfile: Dockerfile workdir: containerized_analytics/smile/topic_modeling - hub_project: socialmediamacroscope/topic_modeling - github_project: ncsa/topic_modeling + docker_repo_tag: socialmediamacroscope/topic_modeling + github_repo_tag: ncsa/topic_modeling steps: # checkout source code - uses: actions/checkout@v2 @@ -171,7 +169,7 @@ jobs: uses: elgohr/Publish-Docker-Github-Action@3.04 with: dockerfile: ${{ matrix.dockerfile }} - name: ${{ matrix.hub_project }} + name: ${{ matrix.docker_repo_tag }} no_push: true workdir: ${{ matrix.workdir }} @@ -183,7 +181,7 @@ jobs: uses: elgohr/Publish-Docker-Github-Action@3.04 with: registry: docker.io - name: ${{ matrix.hub_project }} + name: ${{ matrix.docker_repo_tag }} username: ${{ secrets.HUB_USERNAME }} password: ${{ secrets.HUB_PASSWORD }} tags: "${{ env.TAGS }}" @@ -197,7 +195,7 @@ jobs: uses: elgohr/Publish-Docker-Github-Action@3.04 with: registry: ghcr.io - name: ${{ matrix.github_project }} + name: ${{ matrix.github_repo_tag }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} tags: "${{ env.TAGS }}" From f42b43439f77fa601a1d75b2516e0402cc1cc10b Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Tue, 5 Dec 2023 07:28:45 -0600 Subject: [PATCH 59/75] rename comments --- .github/workflows/docker.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 45159b79..22139436 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -177,7 +177,6 @@ jobs: if: | github.repository == env.MAIN_REPO && (github.event_name == env.GITHUB_BRANCH == 'main') -# if: github.repository == env.MAIN_REPO uses: elgohr/Publish-Docker-Github-Action@3.04 with: registry: docker.io @@ -191,7 +190,6 @@ jobs: if: | github.repository == env.MAIN_REPO && (github.event_name == env.GITHUB_BRANCH == 'develop') -# if: github.repository == env.MAIN_REPO uses: elgohr/Publish-Docker-Github-Action@3.04 with: registry: ghcr.io From fce2de4461c764a3e5298b8d60076c9df21102bd Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Tue, 5 Dec 2023 07:34:40 -0600 Subject: [PATCH 60/75] added clowder containers --- .github/workflows/docker.yml | 39 +++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 22139436..612c3031 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -10,6 +10,8 @@ on: tags: - '*' + pull_request: + env: MAIN_REPO: ncsa/standalone-smm-analytics @@ -39,6 +41,11 @@ jobs: - screen_name_prompt - sentiment_analysis - topic_modeling + - clowder_create_collection + - clowder_create_dataset + - clowder_create_space + - clowder_list + - clowder_upload_file include: - name: autophrase dockerfile: Dockerfile @@ -115,6 +122,31 @@ jobs: workdir: containerized_analytics/smile/topic_modeling docker_repo_tag: socialmediamacroscope/topic_modeling github_repo_tag: ncsa/topic_modeling + - name: clowder_create_collection + dockerfile: Dockerfile + workdir: containerized_analytics/clowder/clowder_create_collection + docker_repo_tag: socialmediamacroscope/clowder_create_collection + github_repo_tag: ncsa/clowder_create_collection + - name: clowder_create_dataset + dockerfile: Dockerfile + workdir: containerized_analytics/clowder/clowder_create_dataset + docker_repo_tag: socialmediamacroscope/clowder_create_dataset + github_repo_tag: ncsa/clowder_create_dataset + - name: clowder_create_space + dockerfile: Dockerfile + workdir: containerized_analytics/clowder/clowder_create_space + docker_repo_tag: socialmediamacroscope/clowder_create_space + github_repo_tag: ncsa/clowder_create_space + - name: clowder_list + dockerfile: Dockerfile + workdir: containerized_analytics/clowder/clowder_list + docker_repo_tag: socialmediamacroscope/clowder_list + github_repo_tag: ncsa/clowder_list + - name: clowder_upload_file + dockerfile: Dockerfile + workdir: containerized_analytics/clowder/clowder_upload_file + docker_repo_tag: socialmediamacroscope/clowder_upload_file + github_repo_tag: ncsa/clowder_upload_file steps: # checkout source code - uses: actions/checkout@v2 @@ -187,9 +219,10 @@ jobs: workdir: ${{ matrix.workdir }} - name: Publish doc image to Github - if: | - github.repository == env.MAIN_REPO && - (github.event_name == env.GITHUB_BRANCH == 'develop') +# if: | +# github.repository == env.MAIN_REPO && +# (github.event_name == env.GITHUB_BRANCH == 'develop') + if: github.repository == env.MAIN_REPO uses: elgohr/Publish-Docker-Github-Action@3.04 with: registry: ghcr.io From a55545a7bf45c3851518f2b368f9518583f2e938 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Tue, 5 Dec 2023 07:37:41 -0600 Subject: [PATCH 61/75] added test --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 612c3031..28f12a62 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -10,7 +10,7 @@ on: tags: - '*' - pull_request: + pull_request: env: MAIN_REPO: ncsa/standalone-smm-analytics From cb17e9c5adf857641097a00b588851382da9bb4c Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Tue, 5 Dec 2023 07:40:20 -0600 Subject: [PATCH 62/75] fixed repo name --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 28f12a62..1e7f4b9e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -51,7 +51,7 @@ jobs: dockerfile: Dockerfile workdir: containerized_analytics/smile/autophrase docker_repo_tag: socialmediamacroscope/autophrase - gitdocker_repo_tag: ncsa/autophrase + github_repo_tag: ncsa/autophrase - name: histogram dockerfile: Dockerfile workdir: containerized_analytics/smile/histogram From f3a50612c1978009c902bb4de6356ca838399d56 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Tue, 5 Dec 2023 07:44:35 -0600 Subject: [PATCH 63/75] removed pull request launch --- .github/workflows/docker.yml | 2 -- CHANGELOG.md | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1e7f4b9e..540fbb83 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -10,8 +10,6 @@ on: tags: - '*' - pull_request: - env: MAIN_REPO: ncsa/standalone-smm-analytics diff --git a/CHANGELOG.md b/CHANGELOG.md index f309edda..621b8239 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added +- Github action for building containers [#26](https://github.com/ncsa/standalone-smm-analytics/issues/26) + ### Changed - Reorganized repository structure [#10](https://github.com/ncsa/standalone-smm-analytics/issues/10) From 55b357b4418c2103d35e509bc336eb91eef1abdd Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Tue, 5 Dec 2023 10:43:22 -0600 Subject: [PATCH 64/75] added manual trigger --- .github/workflows/docker.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 540fbb83..927c85a8 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -10,6 +10,8 @@ on: tags: - '*' + workflow_dispatch: + env: MAIN_REPO: ncsa/standalone-smm-analytics From a25517edbcd0e2c5f7bb0da40329af047d342019 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Tue, 5 Dec 2023 10:48:45 -0600 Subject: [PATCH 65/75] 1st test --- .github/workflows/docker.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 927c85a8..28855bf4 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,16 +1,16 @@ name: CI on: - push: - branches: - - main - - develop - - 'release/*' +# push: +# branches: +# - main +# - develop +# - 'release/*' +# +# tags: +# - '*' - tags: - - '*' - - workflow_dispatch: + workflow_dispatch: env: MAIN_REPO: ncsa/standalone-smm-analytics From 40f35d982f15e64d6c2cfca58d53dd37a4d6e3e6 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Tue, 5 Dec 2023 10:52:36 -0600 Subject: [PATCH 66/75] 2nd test --- .github/workflows/docker.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 28855bf4..b0edab26 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,15 +1,11 @@ name: CI on: -# push: -# branches: -# - main -# - develop -# - 'release/*' -# -# tags: -# - '*' - + push: + branches: + - main + - develop + - 'release/*' workflow_dispatch: env: From 5162f0dc5406eb013095db9048569888341d92ba Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Tue, 5 Dec 2023 10:53:59 -0600 Subject: [PATCH 67/75] 3rd test --- .github/workflows/manual_docker.yml | 224 ++++++++++++++++++++++++++++ 1 file changed, 224 insertions(+) create mode 100644 .github/workflows/manual_docker.yml diff --git a/.github/workflows/manual_docker.yml b/.github/workflows/manual_docker.yml new file mode 100644 index 00000000..47ce13ee --- /dev/null +++ b/.github/workflows/manual_docker.yml @@ -0,0 +1,224 @@ +name: CI-Manual + +on: + workflow_dispatch: + +env: + MAIN_REPO: ncsa/standalone-smm-analytics + +jobs: + + # ---------------------------------------------------------------------- + # DOCKER BUILD + # ---------------------------------------------------------------------- + docker: + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + name: + - autophrase + - histogram + - check_screen_name + - classification_predict + - classification_train + - classification_split + - collect_reddit_comment + - crimson_hexagon_monitors + - image_crawler + - name_entity_recognition + - network_analysis + - preprocessing + - screen_name_prompt + - sentiment_analysis + - topic_modeling + - clowder_create_collection + - clowder_create_dataset + - clowder_create_space + - clowder_list + - clowder_upload_file + include: + - name: autophrase + dockerfile: Dockerfile + workdir: containerized_analytics/smile/autophrase + docker_repo_tag: socialmediamacroscope/autophrase + github_repo_tag: ncsa/autophrase + - name: histogram + dockerfile: Dockerfile + workdir: containerized_analytics/smile/histogram + docker_repo_tag: socialmediamacroscope/histogram + github_repo_tag: ncsa/histogram + - name: check_screen_name + dockerfile: Dockerfile + workdir: containerized_analytics/smile/check_screen_name + docker_repo_tag: socialmediamacroscope/check_screen_name + github_repo_tag: ncsa/check_screen_name + - name: classification_predict + dockerfile: Dockerfile + workdir: containerized_analytics/smile/classification_predict + docker_repo_tag: socialmediamacroscope/classification_predict + github_repo_tag: ncsa/classification_predict + - name: classification_train + dockerfile: Dockerfile + workdir: containerized_analytics/smile/classification_train + docker_repo_tag: socialmediamacroscope/classification_train + github_repo_tag: ncsa/classification_train + - name: classification_split + dockerfile: Dockerfile + workdir: containerized_analytics/smile/classification_split + docker_repo_tag: socialmediamacroscope/classification_split + github_repo_tag: ncsa/classification_split + - name: collect_reddit_comment + dockerfile: Dockerfile + workdir: containerized_analytics/smile/collect_reddit_comment + docker_repo_tag: socialmediamacroscope/collect_reddit_comment + github_repo_tag: ncsa/collect_reddit_comment + - name: crimson_hexagon_monitors + dockerfile: Dockerfile + workdir: containerized_analytics/smile/crimson_hexagon_monitors + docker_repo_tag: socialmediamacroscope/crimson_hexagon_monitors + github_repo_tag: ncsa/crimson_hexagon_monitors + - name: image_crawler + dockerfile: Dockerfile + workdir: containerized_analytics/smile/image_crawler + docker_repo_tag: socialmediamacroscope/image_crawler + github_repo_tag: ncsa/image_crawler + - name: name_entity_recognition + dockerfile: Dockerfile + workdir: containerized_analytics/smile/name_entity_recognition + docker_repo_tag: socialmediamacroscope/name_entity_recognition + github_repo_tag: ncsa/name_entity_recognition + - name: network_analysis + dockerfile: Dockerfile + workdir: containerized_analytics/smile/network_analysis + docker_repo_tag: socialmediamacroscope/network_analysis + github_repo_tag: ncsa/network_analysis + - name: preprocessing + dockerfile: Dockerfile + workdir: containerized_analytics/smile/preprocessing + docker_repo_tag: socialmediamacroscope/preprocessing + github_repo_tag: ncsa/preprocessing + - name: screen_name_prompt + dockerfile: Dockerfile + workdir: containerized_analytics/smile/screen_name_prompt + docker_repo_tag: socialmediamacroscope/screen_name_prompt + github_repo_tag: ncsa/screen_name_prompt + - name: sentiment_analysis + dockerfile: Dockerfile + workdir: containerized_analytics/smile/sentiment_analysis + docker_repo_tag: socialmediamacroscope/sentiment_analysis + github_repo_tag: ncsa/sentiment_analysis + - name: topic_modeling + dockerfile: Dockerfile + workdir: containerized_analytics/smile/topic_modeling + docker_repo_tag: socialmediamacroscope/topic_modeling + github_repo_tag: ncsa/topic_modeling + - name: clowder_create_collection + dockerfile: Dockerfile + workdir: containerized_analytics/clowder/clowder_create_collection + docker_repo_tag: socialmediamacroscope/clowder_create_collection + github_repo_tag: ncsa/clowder_create_collection + - name: clowder_create_dataset + dockerfile: Dockerfile + workdir: containerized_analytics/clowder/clowder_create_dataset + docker_repo_tag: socialmediamacroscope/clowder_create_dataset + github_repo_tag: ncsa/clowder_create_dataset + - name: clowder_create_space + dockerfile: Dockerfile + workdir: containerized_analytics/clowder/clowder_create_space + docker_repo_tag: socialmediamacroscope/clowder_create_space + github_repo_tag: ncsa/clowder_create_space + - name: clowder_list + dockerfile: Dockerfile + workdir: containerized_analytics/clowder/clowder_list + docker_repo_tag: socialmediamacroscope/clowder_list + github_repo_tag: ncsa/clowder_list + - name: clowder_upload_file + dockerfile: Dockerfile + workdir: containerized_analytics/clowder/clowder_upload_file + docker_repo_tag: socialmediamacroscope/clowder_upload_file + github_repo_tag: ncsa/clowder_upload_file + steps: + # checkout source code + - uses: actions/checkout@v2 + + # calculate version information + - name: version information + run: | + if [ "${{ github.event.release.target_commitish }}" != "" ]; then + BRANCH="${{ github.event.release.target_commitish }}" + elif [[ "${{github.event_name}}" == "pull_request" ]]; then + BRANCH="PR-${{github.event.pull_request.number}}" + else + BRANCH=${GITHUB_REF##*/} + fi + echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV + + if [ "$BRANCH" == "main" ]; then + VERSION=$(cat manual_jb/content/_config.yml | grep "version" | head -1 | awk -F= "{print $2 }" | sed "s/[[:alpha:]|,|-|\"|:|#|[:space:]]//g" | sed "s/-//g") + VERSIONS="latest" + OLDVERSION="" + TMPVERSION=$VERSION + while [ "$OLDVERSION" != "$TMPVERSION" ]; do + VERSIONS="${VERSIONS} ${TMPVERSION}" + OLDVERSION="${TMPVERSION}" + TMPVERSION=$(echo ${OLDVERSION} | sed 's/\.[0-9]*$//') + done + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "TAGS=${VERSIONS}" >> $GITHUB_ENV + elif [ "$BRANCH" == "develop" ]; then + echo "VERSION=develop" >> $GITHUB_ENV + echo "TAGS=develop" >> $GITHUB_ENV + else + echo "VERSION=testing" >> $GITHUB_ENV + echo "TAGS=${BRANCH}" >> $GITHUB_ENV + fi + + - name: Print Version tag + run: echo "${{ env.TAGS }}" + + # login to registries + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build docker image + if: | + github.repository == env.MAIN_REPO && + (github.event_name == env.GITHUB_BRANCH == 'main') + uses: elgohr/Publish-Docker-Github-Action@3.04 + with: + dockerfile: ${{ matrix.dockerfile }} + name: ${{ matrix.docker_repo_tag }} + no_push: true + workdir: ${{ matrix.workdir }} + + - name: Publish doc image to Docker Hub + if: | + github.repository == env.MAIN_REPO && + (github.event_name == env.GITHUB_BRANCH == 'main') + uses: elgohr/Publish-Docker-Github-Action@3.04 + with: + registry: docker.io + name: ${{ matrix.docker_repo_tag }} + username: ${{ secrets.HUB_USERNAME }} + password: ${{ secrets.HUB_PASSWORD }} + tags: "${{ env.TAGS }}" + workdir: ${{ matrix.workdir }} + + - name: Publish doc image to Github +# if: | +# github.repository == env.MAIN_REPO && +# (github.event_name == env.GITHUB_BRANCH == 'develop') + if: github.repository == env.MAIN_REPO + uses: elgohr/Publish-Docker-Github-Action@3.04 + with: + registry: ghcr.io + name: ${{ matrix.github_repo_tag }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + tags: "${{ env.TAGS }}" + workdir: ${{ matrix.workdir }} From 098e08eb7b8274e340b5296f245e9c93e7e3bbdb Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Tue, 5 Dec 2023 10:58:23 -0600 Subject: [PATCH 68/75] 4th test --- .github/workflows/manual_docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manual_docker.yml b/.github/workflows/manual_docker.yml index 47ce13ee..c238e81f 100644 --- a/.github/workflows/manual_docker.yml +++ b/.github/workflows/manual_docker.yml @@ -213,7 +213,7 @@ jobs: # if: | # github.repository == env.MAIN_REPO && # (github.event_name == env.GITHUB_BRANCH == 'develop') - if: github.repository == env.MAIN_REPO +# if: github.repository == env.MAIN_REPO uses: elgohr/Publish-Docker-Github-Action@3.04 with: registry: ghcr.io From 26d0a7e1ebe83a356da681c45ee0213d673715d0 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Tue, 5 Dec 2023 11:00:25 -0600 Subject: [PATCH 69/75] 5th test --- .github/workflows/docker.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b0edab26..242b4639 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -6,7 +6,6 @@ on: - main - develop - 'release/*' - workflow_dispatch: env: MAIN_REPO: ncsa/standalone-smm-analytics From c2582b83b8ca5502a12e6373d1e1fe4ee69faf3b Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Tue, 5 Dec 2023 11:05:17 -0600 Subject: [PATCH 70/75] rolled back --- .github/workflows/docker.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 242b4639..1e7f4b9e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -7,6 +7,11 @@ on: - develop - 'release/*' + tags: + - '*' + + pull_request: + env: MAIN_REPO: ncsa/standalone-smm-analytics From 5ea16ef49bb328bb7188b988b8a4b855b99f7b5e Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Tue, 5 Dec 2023 11:12:18 -0600 Subject: [PATCH 71/75] create new file --- .github/workflows/docker.yml | 7 +- .github/workflows/manual_docker.yml | 224 +--------------------------- 2 files changed, 5 insertions(+), 226 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1e7f4b9e..dac75dd8 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -219,10 +219,9 @@ jobs: workdir: ${{ matrix.workdir }} - name: Publish doc image to Github -# if: | -# github.repository == env.MAIN_REPO && -# (github.event_name == env.GITHUB_BRANCH == 'develop') - if: github.repository == env.MAIN_REPO + if: | + github.repository == env.MAIN_REPO && + (github.event_name == env.GITHUB_BRANCH == 'develop') uses: elgohr/Publish-Docker-Github-Action@3.04 with: registry: ghcr.io diff --git a/.github/workflows/manual_docker.yml b/.github/workflows/manual_docker.yml index c238e81f..e5acdf37 100644 --- a/.github/workflows/manual_docker.yml +++ b/.github/workflows/manual_docker.yml @@ -1,224 +1,4 @@ -name: CI-Manual +name: Manual trigger on: - workflow_dispatch: - -env: - MAIN_REPO: ncsa/standalone-smm-analytics - -jobs: - - # ---------------------------------------------------------------------- - # DOCKER BUILD - # ---------------------------------------------------------------------- - docker: - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - name: - - autophrase - - histogram - - check_screen_name - - classification_predict - - classification_train - - classification_split - - collect_reddit_comment - - crimson_hexagon_monitors - - image_crawler - - name_entity_recognition - - network_analysis - - preprocessing - - screen_name_prompt - - sentiment_analysis - - topic_modeling - - clowder_create_collection - - clowder_create_dataset - - clowder_create_space - - clowder_list - - clowder_upload_file - include: - - name: autophrase - dockerfile: Dockerfile - workdir: containerized_analytics/smile/autophrase - docker_repo_tag: socialmediamacroscope/autophrase - github_repo_tag: ncsa/autophrase - - name: histogram - dockerfile: Dockerfile - workdir: containerized_analytics/smile/histogram - docker_repo_tag: socialmediamacroscope/histogram - github_repo_tag: ncsa/histogram - - name: check_screen_name - dockerfile: Dockerfile - workdir: containerized_analytics/smile/check_screen_name - docker_repo_tag: socialmediamacroscope/check_screen_name - github_repo_tag: ncsa/check_screen_name - - name: classification_predict - dockerfile: Dockerfile - workdir: containerized_analytics/smile/classification_predict - docker_repo_tag: socialmediamacroscope/classification_predict - github_repo_tag: ncsa/classification_predict - - name: classification_train - dockerfile: Dockerfile - workdir: containerized_analytics/smile/classification_train - docker_repo_tag: socialmediamacroscope/classification_train - github_repo_tag: ncsa/classification_train - - name: classification_split - dockerfile: Dockerfile - workdir: containerized_analytics/smile/classification_split - docker_repo_tag: socialmediamacroscope/classification_split - github_repo_tag: ncsa/classification_split - - name: collect_reddit_comment - dockerfile: Dockerfile - workdir: containerized_analytics/smile/collect_reddit_comment - docker_repo_tag: socialmediamacroscope/collect_reddit_comment - github_repo_tag: ncsa/collect_reddit_comment - - name: crimson_hexagon_monitors - dockerfile: Dockerfile - workdir: containerized_analytics/smile/crimson_hexagon_monitors - docker_repo_tag: socialmediamacroscope/crimson_hexagon_monitors - github_repo_tag: ncsa/crimson_hexagon_monitors - - name: image_crawler - dockerfile: Dockerfile - workdir: containerized_analytics/smile/image_crawler - docker_repo_tag: socialmediamacroscope/image_crawler - github_repo_tag: ncsa/image_crawler - - name: name_entity_recognition - dockerfile: Dockerfile - workdir: containerized_analytics/smile/name_entity_recognition - docker_repo_tag: socialmediamacroscope/name_entity_recognition - github_repo_tag: ncsa/name_entity_recognition - - name: network_analysis - dockerfile: Dockerfile - workdir: containerized_analytics/smile/network_analysis - docker_repo_tag: socialmediamacroscope/network_analysis - github_repo_tag: ncsa/network_analysis - - name: preprocessing - dockerfile: Dockerfile - workdir: containerized_analytics/smile/preprocessing - docker_repo_tag: socialmediamacroscope/preprocessing - github_repo_tag: ncsa/preprocessing - - name: screen_name_prompt - dockerfile: Dockerfile - workdir: containerized_analytics/smile/screen_name_prompt - docker_repo_tag: socialmediamacroscope/screen_name_prompt - github_repo_tag: ncsa/screen_name_prompt - - name: sentiment_analysis - dockerfile: Dockerfile - workdir: containerized_analytics/smile/sentiment_analysis - docker_repo_tag: socialmediamacroscope/sentiment_analysis - github_repo_tag: ncsa/sentiment_analysis - - name: topic_modeling - dockerfile: Dockerfile - workdir: containerized_analytics/smile/topic_modeling - docker_repo_tag: socialmediamacroscope/topic_modeling - github_repo_tag: ncsa/topic_modeling - - name: clowder_create_collection - dockerfile: Dockerfile - workdir: containerized_analytics/clowder/clowder_create_collection - docker_repo_tag: socialmediamacroscope/clowder_create_collection - github_repo_tag: ncsa/clowder_create_collection - - name: clowder_create_dataset - dockerfile: Dockerfile - workdir: containerized_analytics/clowder/clowder_create_dataset - docker_repo_tag: socialmediamacroscope/clowder_create_dataset - github_repo_tag: ncsa/clowder_create_dataset - - name: clowder_create_space - dockerfile: Dockerfile - workdir: containerized_analytics/clowder/clowder_create_space - docker_repo_tag: socialmediamacroscope/clowder_create_space - github_repo_tag: ncsa/clowder_create_space - - name: clowder_list - dockerfile: Dockerfile - workdir: containerized_analytics/clowder/clowder_list - docker_repo_tag: socialmediamacroscope/clowder_list - github_repo_tag: ncsa/clowder_list - - name: clowder_upload_file - dockerfile: Dockerfile - workdir: containerized_analytics/clowder/clowder_upload_file - docker_repo_tag: socialmediamacroscope/clowder_upload_file - github_repo_tag: ncsa/clowder_upload_file - steps: - # checkout source code - - uses: actions/checkout@v2 - - # calculate version information - - name: version information - run: | - if [ "${{ github.event.release.target_commitish }}" != "" ]; then - BRANCH="${{ github.event.release.target_commitish }}" - elif [[ "${{github.event_name}}" == "pull_request" ]]; then - BRANCH="PR-${{github.event.pull_request.number}}" - else - BRANCH=${GITHUB_REF##*/} - fi - echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV - - if [ "$BRANCH" == "main" ]; then - VERSION=$(cat manual_jb/content/_config.yml | grep "version" | head -1 | awk -F= "{print $2 }" | sed "s/[[:alpha:]|,|-|\"|:|#|[:space:]]//g" | sed "s/-//g") - VERSIONS="latest" - OLDVERSION="" - TMPVERSION=$VERSION - while [ "$OLDVERSION" != "$TMPVERSION" ]; do - VERSIONS="${VERSIONS} ${TMPVERSION}" - OLDVERSION="${TMPVERSION}" - TMPVERSION=$(echo ${OLDVERSION} | sed 's/\.[0-9]*$//') - done - echo "VERSION=$VERSION" >> $GITHUB_ENV - echo "TAGS=${VERSIONS}" >> $GITHUB_ENV - elif [ "$BRANCH" == "develop" ]; then - echo "VERSION=develop" >> $GITHUB_ENV - echo "TAGS=develop" >> $GITHUB_ENV - else - echo "VERSION=testing" >> $GITHUB_ENV - echo "TAGS=${BRANCH}" >> $GITHUB_ENV - fi - - - name: Print Version tag - run: echo "${{ env.TAGS }}" - - # login to registries - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build docker image - if: | - github.repository == env.MAIN_REPO && - (github.event_name == env.GITHUB_BRANCH == 'main') - uses: elgohr/Publish-Docker-Github-Action@3.04 - with: - dockerfile: ${{ matrix.dockerfile }} - name: ${{ matrix.docker_repo_tag }} - no_push: true - workdir: ${{ matrix.workdir }} - - - name: Publish doc image to Docker Hub - if: | - github.repository == env.MAIN_REPO && - (github.event_name == env.GITHUB_BRANCH == 'main') - uses: elgohr/Publish-Docker-Github-Action@3.04 - with: - registry: docker.io - name: ${{ matrix.docker_repo_tag }} - username: ${{ secrets.HUB_USERNAME }} - password: ${{ secrets.HUB_PASSWORD }} - tags: "${{ env.TAGS }}" - workdir: ${{ matrix.workdir }} - - - name: Publish doc image to Github -# if: | -# github.repository == env.MAIN_REPO && -# (github.event_name == env.GITHUB_BRANCH == 'develop') -# if: github.repository == env.MAIN_REPO - uses: elgohr/Publish-Docker-Github-Action@3.04 - with: - registry: ghcr.io - name: ${{ matrix.github_repo_tag }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - tags: "${{ env.TAGS }}" - workdir: ${{ matrix.workdir }} + workflow_dispatch: \ No newline at end of file From c1f6f406d5c69891139be9c6e5f844fa9804607a Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Tue, 5 Dec 2023 11:16:12 -0600 Subject: [PATCH 72/75] added job to manual trigger --- .github/workflows/manual_docker.yml | 218 +++++++++++++++++++++++++++- 1 file changed, 217 insertions(+), 1 deletion(-) diff --git a/.github/workflows/manual_docker.yml b/.github/workflows/manual_docker.yml index e5acdf37..70accefb 100644 --- a/.github/workflows/manual_docker.yml +++ b/.github/workflows/manual_docker.yml @@ -1,4 +1,220 @@ name: Manual trigger on: - workflow_dispatch: \ No newline at end of file + workflow_dispatch: + +env: + MAIN_REPO: ncsa/standalone-smm-analytics + +jobs: + + # ---------------------------------------------------------------------- + # DOCKER BUILD + # ---------------------------------------------------------------------- + docker: + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + name: + - autophrase + - histogram + - check_screen_name + - classification_predict + - classification_train + - classification_split + - collect_reddit_comment + - crimson_hexagon_monitors + - image_crawler + - name_entity_recognition + - network_analysis + - preprocessing + - screen_name_prompt + - sentiment_analysis + - topic_modeling + - clowder_create_collection + - clowder_create_dataset + - clowder_create_space + - clowder_list + - clowder_upload_file + include: + - name: autophrase + dockerfile: Dockerfile + workdir: containerized_analytics/smile/autophrase + docker_repo_tag: socialmediamacroscope/autophrase + github_repo_tag: ncsa/autophrase + - name: histogram + dockerfile: Dockerfile + workdir: containerized_analytics/smile/histogram + docker_repo_tag: socialmediamacroscope/histogram + github_repo_tag: ncsa/histogram + - name: check_screen_name + dockerfile: Dockerfile + workdir: containerized_analytics/smile/check_screen_name + docker_repo_tag: socialmediamacroscope/check_screen_name + github_repo_tag: ncsa/check_screen_name + - name: classification_predict + dockerfile: Dockerfile + workdir: containerized_analytics/smile/classification_predict + docker_repo_tag: socialmediamacroscope/classification_predict + github_repo_tag: ncsa/classification_predict + - name: classification_train + dockerfile: Dockerfile + workdir: containerized_analytics/smile/classification_train + docker_repo_tag: socialmediamacroscope/classification_train + github_repo_tag: ncsa/classification_train + - name: classification_split + dockerfile: Dockerfile + workdir: containerized_analytics/smile/classification_split + docker_repo_tag: socialmediamacroscope/classification_split + github_repo_tag: ncsa/classification_split + - name: collect_reddit_comment + dockerfile: Dockerfile + workdir: containerized_analytics/smile/collect_reddit_comment + docker_repo_tag: socialmediamacroscope/collect_reddit_comment + github_repo_tag: ncsa/collect_reddit_comment + - name: crimson_hexagon_monitors + dockerfile: Dockerfile + workdir: containerized_analytics/smile/crimson_hexagon_monitors + docker_repo_tag: socialmediamacroscope/crimson_hexagon_monitors + github_repo_tag: ncsa/crimson_hexagon_monitors + - name: image_crawler + dockerfile: Dockerfile + workdir: containerized_analytics/smile/image_crawler + docker_repo_tag: socialmediamacroscope/image_crawler + github_repo_tag: ncsa/image_crawler + - name: name_entity_recognition + dockerfile: Dockerfile + workdir: containerized_analytics/smile/name_entity_recognition + docker_repo_tag: socialmediamacroscope/name_entity_recognition + github_repo_tag: ncsa/name_entity_recognition + - name: network_analysis + dockerfile: Dockerfile + workdir: containerized_analytics/smile/network_analysis + docker_repo_tag: socialmediamacroscope/network_analysis + github_repo_tag: ncsa/network_analysis + - name: preprocessing + dockerfile: Dockerfile + workdir: containerized_analytics/smile/preprocessing + docker_repo_tag: socialmediamacroscope/preprocessing + github_repo_tag: ncsa/preprocessing + - name: screen_name_prompt + dockerfile: Dockerfile + workdir: containerized_analytics/smile/screen_name_prompt + docker_repo_tag: socialmediamacroscope/screen_name_prompt + github_repo_tag: ncsa/screen_name_prompt + - name: sentiment_analysis + dockerfile: Dockerfile + workdir: containerized_analytics/smile/sentiment_analysis + docker_repo_tag: socialmediamacroscope/sentiment_analysis + github_repo_tag: ncsa/sentiment_analysis + - name: topic_modeling + dockerfile: Dockerfile + workdir: containerized_analytics/smile/topic_modeling + docker_repo_tag: socialmediamacroscope/topic_modeling + github_repo_tag: ncsa/topic_modeling + - name: clowder_create_collection + dockerfile: Dockerfile + workdir: containerized_analytics/clowder/clowder_create_collection + docker_repo_tag: socialmediamacroscope/clowder_create_collection + github_repo_tag: ncsa/clowder_create_collection + - name: clowder_create_dataset + dockerfile: Dockerfile + workdir: containerized_analytics/clowder/clowder_create_dataset + docker_repo_tag: socialmediamacroscope/clowder_create_dataset + github_repo_tag: ncsa/clowder_create_dataset + - name: clowder_create_space + dockerfile: Dockerfile + workdir: containerized_analytics/clowder/clowder_create_space + docker_repo_tag: socialmediamacroscope/clowder_create_space + github_repo_tag: ncsa/clowder_create_space + - name: clowder_list + dockerfile: Dockerfile + workdir: containerized_analytics/clowder/clowder_list + docker_repo_tag: socialmediamacroscope/clowder_list + github_repo_tag: ncsa/clowder_list + - name: clowder_upload_file + dockerfile: Dockerfile + workdir: containerized_analytics/clowder/clowder_upload_file + docker_repo_tag: socialmediamacroscope/clowder_upload_file + github_repo_tag: ncsa/clowder_upload_file + steps: + # checkout source code + - uses: actions/checkout@v2 + + # calculate version information + - name: version information + run: | + if [ "${{ github.event.release.target_commitish }}" != "" ]; then + BRANCH="${{ github.event.release.target_commitish }}" + elif [[ "${{github.event_name}}" == "pull_request" ]]; then + BRANCH="PR-${{github.event.pull_request.number}}" + else + BRANCH=${GITHUB_REF##*/} + fi + echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV + + if [ "$BRANCH" == "main" ]; then + VERSION=$(cat manual_jb/content/_config.yml | grep "version" | head -1 | awk -F= "{print $2 }" | sed "s/[[:alpha:]|,|-|\"|:|#|[:space:]]//g" | sed "s/-//g") + VERSIONS="latest" + OLDVERSION="" + TMPVERSION=$VERSION + while [ "$OLDVERSION" != "$TMPVERSION" ]; do + VERSIONS="${VERSIONS} ${TMPVERSION}" + OLDVERSION="${TMPVERSION}" + TMPVERSION=$(echo ${OLDVERSION} | sed 's/\.[0-9]*$//') + done + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "TAGS=${VERSIONS}" >> $GITHUB_ENV + elif [ "$BRANCH" == "develop" ]; then + echo "VERSION=develop" >> $GITHUB_ENV + echo "TAGS=develop" >> $GITHUB_ENV + else + echo "VERSION=testing" >> $GITHUB_ENV + echo "TAGS=${BRANCH}" >> $GITHUB_ENV + fi + + - name: Print Version tag + run: echo "${{ env.TAGS }}" + + # login to registries + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build docker image + if: | + github.repository == env.MAIN_REPO && + (github.event_name == env.GITHUB_BRANCH == 'main') + uses: elgohr/Publish-Docker-Github-Action@3.04 + with: + dockerfile: ${{ matrix.dockerfile }} + name: ${{ matrix.docker_repo_tag }} + no_push: true + workdir: ${{ matrix.workdir }} + + - name: Publish doc image to Docker Hub + if: | + github.repository == env.MAIN_REPO && + (github.event_name == env.GITHUB_BRANCH == 'main') + uses: elgohr/Publish-Docker-Github-Action@3.04 + with: + registry: docker.io + name: ${{ matrix.docker_repo_tag }} + username: ${{ secrets.HUB_USERNAME }} + password: ${{ secrets.HUB_PASSWORD }} + tags: "${{ env.TAGS }}" + workdir: ${{ matrix.workdir }} + + - name: Publish doc image to Github + uses: elgohr/Publish-Docker-Github-Action@3.04 + with: + registry: ghcr.io + name: ${{ matrix.github_repo_tag }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + tags: "${{ env.TAGS }}" + workdir: ${{ matrix.workdir }} \ No newline at end of file From ff05e2f1a13f501bccc0e23e6dae2bbdb892ee03 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 7 Dec 2023 14:43:49 -0600 Subject: [PATCH 73/75] modified docker.yml --- .github/workflows/docker.yml | 6 +- .github/workflows/manual_docker.yml | 220 ---------------------------- 2 files changed, 4 insertions(+), 222 deletions(-) delete mode 100644 .github/workflows/manual_docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index dac75dd8..ccaae4b0 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -208,7 +208,8 @@ jobs: - name: Publish doc image to Docker Hub if: | github.repository == env.MAIN_REPO && - (github.event_name == env.GITHUB_BRANCH == 'main') + github.event_name == "push" && + env.GITHUB_BRANCH == 'main' uses: elgohr/Publish-Docker-Github-Action@3.04 with: registry: docker.io @@ -221,7 +222,8 @@ jobs: - name: Publish doc image to Github if: | github.repository == env.MAIN_REPO && - (github.event_name == env.GITHUB_BRANCH == 'develop') + github.event_name == "push" && + env.GITHUB_BRANCH == 'main' uses: elgohr/Publish-Docker-Github-Action@3.04 with: registry: ghcr.io diff --git a/.github/workflows/manual_docker.yml b/.github/workflows/manual_docker.yml deleted file mode 100644 index 70accefb..00000000 --- a/.github/workflows/manual_docker.yml +++ /dev/null @@ -1,220 +0,0 @@ -name: Manual trigger - -on: - workflow_dispatch: - -env: - MAIN_REPO: ncsa/standalone-smm-analytics - -jobs: - - # ---------------------------------------------------------------------- - # DOCKER BUILD - # ---------------------------------------------------------------------- - docker: - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - name: - - autophrase - - histogram - - check_screen_name - - classification_predict - - classification_train - - classification_split - - collect_reddit_comment - - crimson_hexagon_monitors - - image_crawler - - name_entity_recognition - - network_analysis - - preprocessing - - screen_name_prompt - - sentiment_analysis - - topic_modeling - - clowder_create_collection - - clowder_create_dataset - - clowder_create_space - - clowder_list - - clowder_upload_file - include: - - name: autophrase - dockerfile: Dockerfile - workdir: containerized_analytics/smile/autophrase - docker_repo_tag: socialmediamacroscope/autophrase - github_repo_tag: ncsa/autophrase - - name: histogram - dockerfile: Dockerfile - workdir: containerized_analytics/smile/histogram - docker_repo_tag: socialmediamacroscope/histogram - github_repo_tag: ncsa/histogram - - name: check_screen_name - dockerfile: Dockerfile - workdir: containerized_analytics/smile/check_screen_name - docker_repo_tag: socialmediamacroscope/check_screen_name - github_repo_tag: ncsa/check_screen_name - - name: classification_predict - dockerfile: Dockerfile - workdir: containerized_analytics/smile/classification_predict - docker_repo_tag: socialmediamacroscope/classification_predict - github_repo_tag: ncsa/classification_predict - - name: classification_train - dockerfile: Dockerfile - workdir: containerized_analytics/smile/classification_train - docker_repo_tag: socialmediamacroscope/classification_train - github_repo_tag: ncsa/classification_train - - name: classification_split - dockerfile: Dockerfile - workdir: containerized_analytics/smile/classification_split - docker_repo_tag: socialmediamacroscope/classification_split - github_repo_tag: ncsa/classification_split - - name: collect_reddit_comment - dockerfile: Dockerfile - workdir: containerized_analytics/smile/collect_reddit_comment - docker_repo_tag: socialmediamacroscope/collect_reddit_comment - github_repo_tag: ncsa/collect_reddit_comment - - name: crimson_hexagon_monitors - dockerfile: Dockerfile - workdir: containerized_analytics/smile/crimson_hexagon_monitors - docker_repo_tag: socialmediamacroscope/crimson_hexagon_monitors - github_repo_tag: ncsa/crimson_hexagon_monitors - - name: image_crawler - dockerfile: Dockerfile - workdir: containerized_analytics/smile/image_crawler - docker_repo_tag: socialmediamacroscope/image_crawler - github_repo_tag: ncsa/image_crawler - - name: name_entity_recognition - dockerfile: Dockerfile - workdir: containerized_analytics/smile/name_entity_recognition - docker_repo_tag: socialmediamacroscope/name_entity_recognition - github_repo_tag: ncsa/name_entity_recognition - - name: network_analysis - dockerfile: Dockerfile - workdir: containerized_analytics/smile/network_analysis - docker_repo_tag: socialmediamacroscope/network_analysis - github_repo_tag: ncsa/network_analysis - - name: preprocessing - dockerfile: Dockerfile - workdir: containerized_analytics/smile/preprocessing - docker_repo_tag: socialmediamacroscope/preprocessing - github_repo_tag: ncsa/preprocessing - - name: screen_name_prompt - dockerfile: Dockerfile - workdir: containerized_analytics/smile/screen_name_prompt - docker_repo_tag: socialmediamacroscope/screen_name_prompt - github_repo_tag: ncsa/screen_name_prompt - - name: sentiment_analysis - dockerfile: Dockerfile - workdir: containerized_analytics/smile/sentiment_analysis - docker_repo_tag: socialmediamacroscope/sentiment_analysis - github_repo_tag: ncsa/sentiment_analysis - - name: topic_modeling - dockerfile: Dockerfile - workdir: containerized_analytics/smile/topic_modeling - docker_repo_tag: socialmediamacroscope/topic_modeling - github_repo_tag: ncsa/topic_modeling - - name: clowder_create_collection - dockerfile: Dockerfile - workdir: containerized_analytics/clowder/clowder_create_collection - docker_repo_tag: socialmediamacroscope/clowder_create_collection - github_repo_tag: ncsa/clowder_create_collection - - name: clowder_create_dataset - dockerfile: Dockerfile - workdir: containerized_analytics/clowder/clowder_create_dataset - docker_repo_tag: socialmediamacroscope/clowder_create_dataset - github_repo_tag: ncsa/clowder_create_dataset - - name: clowder_create_space - dockerfile: Dockerfile - workdir: containerized_analytics/clowder/clowder_create_space - docker_repo_tag: socialmediamacroscope/clowder_create_space - github_repo_tag: ncsa/clowder_create_space - - name: clowder_list - dockerfile: Dockerfile - workdir: containerized_analytics/clowder/clowder_list - docker_repo_tag: socialmediamacroscope/clowder_list - github_repo_tag: ncsa/clowder_list - - name: clowder_upload_file - dockerfile: Dockerfile - workdir: containerized_analytics/clowder/clowder_upload_file - docker_repo_tag: socialmediamacroscope/clowder_upload_file - github_repo_tag: ncsa/clowder_upload_file - steps: - # checkout source code - - uses: actions/checkout@v2 - - # calculate version information - - name: version information - run: | - if [ "${{ github.event.release.target_commitish }}" != "" ]; then - BRANCH="${{ github.event.release.target_commitish }}" - elif [[ "${{github.event_name}}" == "pull_request" ]]; then - BRANCH="PR-${{github.event.pull_request.number}}" - else - BRANCH=${GITHUB_REF##*/} - fi - echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV - - if [ "$BRANCH" == "main" ]; then - VERSION=$(cat manual_jb/content/_config.yml | grep "version" | head -1 | awk -F= "{print $2 }" | sed "s/[[:alpha:]|,|-|\"|:|#|[:space:]]//g" | sed "s/-//g") - VERSIONS="latest" - OLDVERSION="" - TMPVERSION=$VERSION - while [ "$OLDVERSION" != "$TMPVERSION" ]; do - VERSIONS="${VERSIONS} ${TMPVERSION}" - OLDVERSION="${TMPVERSION}" - TMPVERSION=$(echo ${OLDVERSION} | sed 's/\.[0-9]*$//') - done - echo "VERSION=$VERSION" >> $GITHUB_ENV - echo "TAGS=${VERSIONS}" >> $GITHUB_ENV - elif [ "$BRANCH" == "develop" ]; then - echo "VERSION=develop" >> $GITHUB_ENV - echo "TAGS=develop" >> $GITHUB_ENV - else - echo "VERSION=testing" >> $GITHUB_ENV - echo "TAGS=${BRANCH}" >> $GITHUB_ENV - fi - - - name: Print Version tag - run: echo "${{ env.TAGS }}" - - # login to registries - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build docker image - if: | - github.repository == env.MAIN_REPO && - (github.event_name == env.GITHUB_BRANCH == 'main') - uses: elgohr/Publish-Docker-Github-Action@3.04 - with: - dockerfile: ${{ matrix.dockerfile }} - name: ${{ matrix.docker_repo_tag }} - no_push: true - workdir: ${{ matrix.workdir }} - - - name: Publish doc image to Docker Hub - if: | - github.repository == env.MAIN_REPO && - (github.event_name == env.GITHUB_BRANCH == 'main') - uses: elgohr/Publish-Docker-Github-Action@3.04 - with: - registry: docker.io - name: ${{ matrix.docker_repo_tag }} - username: ${{ secrets.HUB_USERNAME }} - password: ${{ secrets.HUB_PASSWORD }} - tags: "${{ env.TAGS }}" - workdir: ${{ matrix.workdir }} - - - name: Publish doc image to Github - uses: elgohr/Publish-Docker-Github-Action@3.04 - with: - registry: ghcr.io - name: ${{ matrix.github_repo_tag }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - tags: "${{ env.TAGS }}" - workdir: ${{ matrix.workdir }} \ No newline at end of file From 967e50bc0f2fe9234ffb6ce0fb148970acab54a8 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 7 Dec 2023 14:46:20 -0600 Subject: [PATCH 74/75] modified to build only for develop and main --- .github/workflows/docker.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ccaae4b0..55bfe460 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -197,7 +197,8 @@ jobs: - name: Build docker image if: | github.repository == env.MAIN_REPO && - (github.event_name == env.GITHUB_BRANCH == 'main') + github.event_name == 'push' && + (env.GITHUB_BRANCH == 'main' || env.GITHUB_BRANCH == 'develop') uses: elgohr/Publish-Docker-Github-Action@3.04 with: dockerfile: ${{ matrix.dockerfile }} @@ -208,7 +209,7 @@ jobs: - name: Publish doc image to Docker Hub if: | github.repository == env.MAIN_REPO && - github.event_name == "push" && + github.event_name == 'push' && env.GITHUB_BRANCH == 'main' uses: elgohr/Publish-Docker-Github-Action@3.04 with: @@ -222,7 +223,7 @@ jobs: - name: Publish doc image to Github if: | github.repository == env.MAIN_REPO && - github.event_name == "push" && + github.event_name == 'push' && env.GITHUB_BRANCH == 'main' uses: elgohr/Publish-Docker-Github-Action@3.04 with: From bb08da0d6719370fa26e203d577fb734b3ff8367 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Thu, 14 Dec 2023 10:38:20 -0600 Subject: [PATCH 75/75] modified push destination --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 55bfe460..f9bca041 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -224,7 +224,7 @@ jobs: if: | github.repository == env.MAIN_REPO && github.event_name == 'push' && - env.GITHUB_BRANCH == 'main' + env.GITHUB_BRANCH == 'develop' uses: elgohr/Publish-Docker-Github-Action@3.04 with: registry: ghcr.io