From f6cde43605fdd5c3ed676a45fc15101f7b99c681 Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Thu, 7 Jan 2021 12:23:37 +0530 Subject: [PATCH 1/5] adds gha --- .DS_Store | Bin 0 -> 6148 bytes .github/CODEOWNERS | 3 ++ .github/merge-publish.yml | 42 ++++++++++++++++++++++++++ .github/pr-build.yml | 57 ++++++++++++++++++++++++++++++++++++ .github/publish.yml | 60 ++++++++++++++++++++++++++++++++++++++ build.gradle.kts | 4 +-- 6 files changed, 164 insertions(+), 2 deletions(-) create mode 100644 .DS_Store create mode 100644 .github/merge-publish.yml create mode 100644 .github/pr-build.yml create mode 100644 .github/publish.yml diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..0f79029aabbfcd97ba8c85cc7a65f8a291b8c5ee GIT binary patch literal 6148 zcmeHKJxjwt7=BOFT6O8r!SQ~9(AmLQ;_6Za(M8*aR7glEb`OGd@<#~$5zhV-7jg18 z_`G*#ylWD0C?aw%+&#&?Ur(QqT#tyvU@_?vb&05h!5HjesxkKSsMwZS=>dhRF{YGa z8q;l>RHFTYSHLUq*A(D)cb5+NouxVE^8M`($9Xo>bbH73QCS{Eqck7E+gYC7uP&co zPMRVoKa8AB?amVAC;-0%{O;1k@`=}>?X$TImQUwbnoF6R<=+hI{7&B%x22u0zBHu; zjhyb(j;j$ihvK5tW37(Oq&dprLz4Nlp~9SQXu?m)W%KsF?zg$Lj^bqXpq`CW!)DSH z?bga;;cDp02ibHorj9qZD>g$4_aI-P_$ zdEMh literal 0 HcmV?d00001 diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 3d41425..69d8499 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,3 +2,6 @@ # global * @buchi-busireddy @aaron-steinfeld @tim-mwangi @ravisingal @laxmanchekka + +# GH action +.github/ @aaron-steinfeld @jbahire @kotharironak @buchi-busireddy \ No newline at end of file diff --git a/.github/merge-publish.yml b/.github/merge-publish.yml new file mode 100644 index 0000000..f4b5e83 --- /dev/null +++ b/.github/merge-publish.yml @@ -0,0 +1,42 @@ +name: merge-publish +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + merge-publish: + runs-on: ubuntu-20.04 + steps: + # Set fetch-depth: 0 to fetch commit history and tags for use in version calculation + - name: Check out code + uses: actions/checkout@v2.3.4 + with: + fetch-depth: 0 + + - name: create checksum file + uses: hypertrace/github-actions/checksum@main + + - name: Cache packages + uses: actions/cache@v2 + with: + path: ~/.gradle + key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }} + restore-keys: | + gradle-packages-${{ runner.os }}-${{ github.job }} + gradle-packages-${{ runner.os }} + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_READ_USER }} + password: ${{ secrets.DOCKERHUB_READ_TOKEN }} + + - name: push docker image + uses: hypertrace/github-actions/gradle@main + with: + args: dockerPushImages + env: + DOCKER_USERNAME: ${{ secrets.DOCKERHUB_PUBLISH_USER }} + DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PUBLISH_TOKEN }} diff --git a/.github/pr-build.yml b/.github/pr-build.yml new file mode 100644 index 0000000..0cc0c93 --- /dev/null +++ b/.github/pr-build.yml @@ -0,0 +1,57 @@ +name: build and validate +on: + push: + branches: + - main + pull_request_target: + branches: + - main + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + # Set fetch-depth: 0 to fetch commit history and tags for use in version calculation + - name: Check out code + uses: actions/checkout@v2.3.4 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + fetch-depth: 0 + + - name: create checksum file + uses: hypertrace/github-actions/checksum@main + + - name: Cache packages + uses: actions/cache@v2 + with: + path: ~/.gradle + key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }} + restore-keys: | + gradle-packages-${{ runner.os }}-${{ github.job }} + gradle-packages-${{ runner.os }} + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_READ_USER }} + password: ${{ secrets.DOCKERHUB_READ_TOKEN }} + + - name: Build with Gradle + uses: hypertrace/github-actions/gradle@main + with: + args: build dockerBuildImages + + validate-helm-charts: + runs-on: ubuntu-20.04 + steps: + - name: Check out code + uses: actions/checkout@v2.3.4 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + fetch-depth: 0 + + - name: validate charts + uses: hypertrace/github-actions/validate-charts@main + diff --git a/.github/publish.yml b/.github/publish.yml new file mode 100644 index 0000000..4941d12 --- /dev/null +++ b/.github/publish.yml @@ -0,0 +1,60 @@ +name: Publish artifacts +on: +# Will only run when release is published. + release: + types: + - created + workflow_dispatch: + +jobs: + publish-artifacts: + runs-on: ubuntu-20.04 + steps: + # Set fetch-depth: 0 to fetch commit history and tags for use in version calculation + - name: Check out code + uses: actions/checkout@v2.3.4 + with: + fetch-depth: 0 + + - name: create checksum file + uses: hypertrace/github-actions/checksum@main + + - name: Cache packages + uses: actions/cache@v2 + with: + path: ~/.gradle + key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }} + restore-keys: | + gradle-packages-${{ runner.os }}-${{ github.job }} + gradle-packages-${{ runner.os }} + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_READ_USER }} + password: ${{ secrets.DOCKERHUB_READ_TOKEN }} + + - name: publish docker image + uses: hypertrace/github-actions/gradle@main + with: + args: dockerPushImages + env: + DOCKER_USERNAME: ${{ secrets.DOCKERHUB_PUBLISH_USER }} + DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PUBLISH_TOKEN }} + + publish-helm-charts: + needs: publish-artifacts + runs-on: ubuntu-20.04 + steps: + # Set fetch-depth: 0 to fetch commit history and tags for use in version calculation + - name: Checkout Repository + uses: actions/checkout@v2.3.4 + with: + fetch-depth: 0 + + - name: package and release charts + uses: hypertrace/github-actions/helm-gcs-publish@main + with: + helm-gcs-credentials: ${{ secrets.HELM_GCS_CREDENTIALS }} + helm-gcs-repository: ${{ secrets.HELM_GCS_REPOSITORY }} + diff --git a/build.gradle.kts b/build.gradle.kts index eadb42b..e7fa03f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,6 @@ plugins { - id("org.hypertrace.docker-plugin") version "0.7.1" - id("org.hypertrace.docker-publish-plugin") version "0.7.1" + id("org.hypertrace.docker-plugin") version "0.8.1" + id("org.hypertrace.docker-publish-plugin") version "0.8.1" } hypertraceDocker { From bd1fdff719f769527e05bd709e0dd7b14f2bc021 Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Thu, 7 Jan 2021 12:23:57 +0530 Subject: [PATCH 2/5] removes cci --- .circleci/config.yml | 157 ------------------------------------------- 1 file changed, 157 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index efee8f0..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,157 +0,0 @@ -version: 2.1 - -executors: - gradle_docker: - docker: - # This image isn't used to build Java project, rather to invoke Docker with Gradle. - # The version of Docker on cimg/openjdk tends to be slightly behind cimg/base. - - image: cimg/openjdk:14.0.2 - auth: - username: $DOCKERHUB_USERNAME - password: $DOCKERHUB_PASSWORD - helm: - docker: - - image: hypertrace/helm-gcs-packager:0.3.0 - auth: - username: $DOCKERHUB_USERNAME - password: $DOCKERHUB_PASSWORD - -commands: - gradle: - description: 'Run the provided gradle command' - parameters: - args: - type: string - when: - default: "on_success" - type: enum - enum: ["on_fail", "on_success", "always"] - steps: - - run: - name: << parameters.args >> - command: ./gradlew << parameters.args >> --info --max-workers=2 -Dorg.gradle.jvmargs=-Xmx2g -Dorg.gradle.console=plain - when: << parameters.when >> - setup_build_environment: - description: 'Checkout, restore the cache, and setup docker' - steps: - - checkout - - restore_cache: - keys: # Use gradle version for cache, so it doesn't download every time - - v1-dependencies-{{ checksum "./gradle/wrapper/gradle-wrapper.properties" }} - # The remote docker version is independent from what's installed in the gradle_docker image and defaults to Docker 17. - # Use the latest value from https://circleci.com/docs/2.0/building-docker-images/#docker-version - - setup_remote_docker: - version: 19.03.12 - - run: - name: Dockerhub login - command: echo $DOCKERHUB_PASSWORD | docker login --username $DOCKERHUB_USERNAME --password-stdin - save_populated_cache: - description: "Save the gradle binary to the cache so it doesn't have to redownload" - steps: - - save_cache: - paths: - - ~/.gradle - key: v1-dependencies-{{ checksum "./gradle/wrapper/gradle-wrapper.properties" }} - -jobs: - build: - executor: gradle_docker - steps: - - setup_build_environment - - gradle: - args: dockerBuildImages - - save_populated_cache - merge-publish: - executor: gradle_docker - steps: - - setup_build_environment - - gradle: - args: dockerPushImages - release-publish: - executor: gradle_docker - steps: - - setup_build_environment - - gradle: - args: dockerPushImages - validate-charts: - executor: helm - steps: - - checkout - - run: - name: Helm Charts Lint and Template Render - command: | - helm lint --strict ./helm/ - helm template ./helm/ - release-charts: - executor: helm - steps: - - checkout - - run: - name: Add release tag - command: | - git config --global user.email "${CIRCLE_USERNAME}@hypertrace.org" - git config --global user.name "$CIRCLE_USERNAME" - git tag -am "Released by $CIRCLE_USERNAME" $(git describe --abbrev=0 --tags | sed 's/^release-//') - - run: - name: Remove trigger tag - command: git tag -d release-$(git describe --abbrev=0) - - run: - name: Package and Publish Helm Charts - # Read the "name:" from Chart.yaml. The chart version is - - command: | - CHART_VERSION=$(git describe --abbrev=0) - CHART_NAME=$(awk '/^name:/ {print $2}' ./helm/Chart.yaml) - export GOOGLE_APPLICATION_CREDENTIALS=${HOME}/helm-gcs-key.json - echo ${HELM_GCS_CREDENTIALS} > ${GOOGLE_APPLICATION_CREDENTIALS} - helm repo add helm-gcs ${HELM_GCS_REPOSITORY} - helm package --version ${CHART_VERSION} --app-version ${CHART_VERSION} ./helm/ - helm gcs push ${CHART_NAME}-${CHART_VERSION}.tgz helm-gcs --public --retry - - add_ssh_keys: - fingerprints: - # This ssh key gives write permission needed for the following step. - - '18:7e:a0:7c:07:65:32:55:f5:35:a3:02:7f:88:25:21' - - run: - name: Update remote tags - command: git push origin refs/tags/$(git describe --abbrev=0) :refs/tags/release-$(git describe --abbrev=0) - -workflows: - version: 2 - build-and-publish: - jobs: - - build: - context: - - dockerhub-read - - validate-charts: - context: - - dockerhub-read - - merge-publish: - context: - - hypertrace-publishing - - dockerhub-read - requires: - - build - - validate-charts - filters: - branches: - only: - - main - - release-publish: - context: - - hypertrace-publishing - - dockerhub-read - filters: - branches: - ignore: /.*/ - tags: - only: /^release-.*/ - - release-charts: - context: - - hypertrace-publishing - - dockerhub-read - requires: - - release-publish - filters: - branches: - ignore: /.*/ - tags: - only: /^release-.*/ From 7d217ec979a7a56a93c16e5d95a4424b0993fb56 Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Thu, 7 Jan 2021 13:20:52 +0530 Subject: [PATCH 3/5] directory --- .DS_Store | Bin 6148 -> 6148 bytes .github/{ => workflows}/merge-publish.yml | 0 .github/{ => workflows}/pr-build.yml | 0 .github/{ => workflows}/publish.yml | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/merge-publish.yml (100%) rename .github/{ => workflows}/pr-build.yml (100%) rename .github/{ => workflows}/publish.yml (100%) diff --git a/.DS_Store b/.DS_Store index 0f79029aabbfcd97ba8c85cc7a65f8a291b8c5ee..902f1b87556bc5bf99dd4502fb72484c08f49f41 100644 GIT binary patch delta 44 zcmZoMXfc@JFDSskz`)4BAi$85ZWx@LpIfk5kYhD7qrm1hEYZvp8y0M4=lIJH0P+3| AO8@`> delta 205 zcmZoMXfc@JFDk;oz`)4BAi%(o%#g#73M4ag(l;h9XRZgya5CtDL>P*YWetOq^K%P; zvOpkW4 Date: Thu, 7 Jan 2021 20:21:52 +0530 Subject: [PATCH 4/5] addressed aaron's comments on kafka --- .github/workflows/pr-build.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 0cc0c93..ca2b467 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -3,7 +3,7 @@ on: push: branches: - main - pull_request_target: + pull_request: branches: - main @@ -15,8 +15,6 @@ jobs: - name: Check out code uses: actions/checkout@v2.3.4 with: - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} fetch-depth: 0 - name: create checksum file @@ -31,12 +29,6 @@ jobs: gradle-packages-${{ runner.os }}-${{ github.job }} gradle-packages-${{ runner.os }} - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_READ_USER }} - password: ${{ secrets.DOCKERHUB_READ_TOKEN }} - - name: Build with Gradle uses: hypertrace/github-actions/gradle@main with: @@ -48,8 +40,6 @@ jobs: - name: Check out code uses: actions/checkout@v2.3.4 with: - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} fetch-depth: 0 - name: validate charts From ee02a9e536a799b06a252df477370ba9c5dc7f4d Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Thu, 7 Jan 2021 20:31:07 +0530 Subject: [PATCH 5/5] cleanup --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 902f1b87556bc5bf99dd4502fb72484c08f49f41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK!AiqG5S`Vu7QOW7alb(5xtCbt7ZgGCqBWrv8dAjGgCL%#V0*+20jp8N*i z>}=a?(~2h%I|H+Cvoo_Z`$%@PL}Yr?v_sS;q85}f+DEfS*v?v$9Y4ashUXX$JN@e- zpVT~cKp9X5{vreJ!>1z}(hc1O->-S=qu^+6%Znr#jEe!rTD`~T(~Fna+Eaty5!ny z4FmGFQR`r9R;&wE29$xHGQj(Tg)+t-OF_4FpmA3KV1!{O=<_cH$5@ZC$5Id$h>=jB zgc^UvFcOY&>-}PnrJ#h9@s|(dGaG+HF)lmix6YkREU2wApbUfz?8;-C&;OIn_x~_R zpOgV*;9oIdqNJbnuq1!B))vQSt%Y7fS=g@>bRlT`aqK#L6dyvJz-GAvj6Ifu7=h@I NfTKYhW#CsC_yUGcgINFo