|
| 1 | +name: Presto Dev Images |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + prebuild_centos_dependency_image: |
| 7 | + description: 'Prebuilt CentOS dependency image (e.g., org/presto-centos-dependency:tag)' |
| 8 | + type: string |
| 9 | + required: false |
| 10 | + default: '' |
| 11 | + prebuild_ubuntu_dependency_image: |
| 12 | + description: 'Prebuilt Ubuntu dependency image (e.g., org/presto-ubuntu-dependency:tag)' |
| 13 | + type: string |
| 14 | + required: false |
| 15 | + default: '' |
| 16 | + publish_centos_image: |
| 17 | + description: 'Build and publish centos development image' |
| 18 | + type: boolean |
| 19 | + default: true |
| 20 | + required: false |
| 21 | + publish_ubuntu_image: |
| 22 | + description: 'Build and publish ubuntu development image' |
| 23 | + type: boolean |
| 24 | + default: true |
| 25 | + required: false |
| 26 | + tag_image_as_latest: |
| 27 | + description: 'Tag the published images as latest' |
| 28 | + type: boolean |
| 29 | + default: true |
| 30 | + required: false |
| 31 | +env: |
| 32 | + JAVA_VERSION: ${{ vars.JAVA_VERSION || '17' }} |
| 33 | + JAVA_DISTRIBUTION: ${{ vars.JAVA_DISTRIBUTION || 'temurin' }} |
| 34 | + MAVEN_OPTS: ${{ vars.MAVEN_OPTS }} |
| 35 | + DOCKER_REPO: ${{ github.repository }} |
| 36 | + ORG_NAME: ${{ github.repository_owner }} |
| 37 | + RELEASE_BRANCH: release-${{ inputs.RELEASE_VERSION }} |
| 38 | + RELEASE_TAG: ${{ inputs.RELEASE_VERSION }} |
| 39 | + RELEASE_NOTES_COMMIT: ${{ inputs.release-notes-commit }} |
| 40 | + |
| 41 | +jobs: |
| 42 | + publish-centos-images: |
| 43 | + runs-on: ubuntu-latest |
| 44 | + if: ${{ github.event.inputs.publish_centos_image == 'true' }} |
| 45 | + environment: release |
| 46 | + timeout-minutes: 900 |
| 47 | + steps: |
| 48 | + - name: Free disk space |
| 49 | + |
| 50 | + with: |
| 51 | + tool-cache: false |
| 52 | + docker-images: false |
| 53 | + |
| 54 | + - name: Set up JDK ${{ env.JAVA_DISTRIBUTION }}/${{ env.JAVA_VERSION }} |
| 55 | + uses: actions/setup-java@v4 |
| 56 | + with: |
| 57 | + java-version: ${{ env.JAVA_VERSION }} |
| 58 | + distribution: ${{ env.JAVA_DISTRIBUTION }} |
| 59 | + |
| 60 | + - name: Checkout |
| 61 | + uses: actions/checkout@v4 |
| 62 | + |
| 63 | + - name: Get presto release version |
| 64 | + run: | |
| 65 | + PRESTO_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \ |
| 66 | + -Dexpression=project.version -q -ntp -DforceStdout | tail -n 1) |
| 67 | + echo "RELEASE_TAG=$PRESTO_VERSION" >> $GITHUB_ENV |
| 68 | +
|
| 69 | + - name: Initialize prestissimo submodules |
| 70 | + working-directory: presto-native-execution |
| 71 | + run: | |
| 72 | + df -h |
| 73 | + cd ${{ github.workspace }}/presto-native-execution && make submodules |
| 74 | + echo "COMMIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV |
| 75 | +
|
| 76 | + - name: Login to dockerHub |
| 77 | + uses: docker/login-action@v3 |
| 78 | + with: |
| 79 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 80 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 81 | + |
| 82 | + - name: Build centos dependency image |
| 83 | + working-directory: presto-native-execution |
| 84 | + run: | |
| 85 | + df -h |
| 86 | + if [[ -n "${{ github.event.inputs.prebuild_centos_dependency_image }}" ]]; then |
| 87 | + echo "Pulling prebuilt CentOS dependency image: ${{ github.event.inputs.prebuild_centos_dependency_image }}" |
| 88 | + docker pull ${{ github.event.inputs.prebuild_centos_dependency_image }} |
| 89 | + docker tag ${{ github.event.inputs.prebuild_centos_dependency_image }} presto/prestissimo-dependency:centos9 |
| 90 | + else |
| 91 | + docker compose build centos-native-dependency |
| 92 | + docker tag presto/prestissimo-dependency:centos9 ${{ github.repository_owner }}/presto-centos-dependency:${{ env.RELEASE_TAG }}-${{ env.COMMIT_SHA }} |
| 93 | + docker push ${{ github.repository_owner }}/presto-centos-dependency:${{ env.RELEASE_TAG }}-${{ env.COMMIT_SHA }} |
| 94 | + if [[ "${{ github.event.inputs.tag_image_as_latest }}" == "true" ]]; then |
| 95 | + docker tag presto/prestissimo-dependency:centos9 ${{ github.repository_owner }}/presto-centos-dependency:latest |
| 96 | + docker push ${{ github.repository_owner }}/presto-centos-dependency:latest |
| 97 | + fi |
| 98 | + fi |
| 99 | + docker images |
| 100 | +
|
| 101 | + - name: Build centos dev images |
| 102 | + working-directory: docker |
| 103 | + run: | |
| 104 | + df -h |
| 105 | + docker compose build centos-dev |
| 106 | + docker images |
| 107 | +
|
| 108 | + - name: Publish centos dev images |
| 109 | + working-directory: docker |
| 110 | + run: | |
| 111 | + df -h |
| 112 | + docker tag presto/presto-dev:centos9 ${{ env.ORG_NAME }}/presto-centos-dev:${{env.RELEASE_TAG }} |
| 113 | + docker push ${{ env.ORG_NAME }}/presto-centos-dev:${{ env.RELEASE_TAG }} |
| 114 | + if [[ "${{ github.event.inputs.tag_image_as_latest }}" == "true" ]]; then |
| 115 | + docker tag presto/presto-dev:centos9 ${{ env.ORG_NAME }}/presto-centos-dev:latest |
| 116 | + docker push ${{ env.ORG_NAME }}/presto-centos-dev:latest |
| 117 | + fi |
| 118 | + docker images |
| 119 | +
|
| 120 | + publish-ubuntu-images: |
| 121 | + runs-on: ubuntu-latest |
| 122 | + if: ${{ github.event.inputs.publish_ubuntu_image == 'true' }} |
| 123 | + environment: release |
| 124 | + timeout-minutes: 900 |
| 125 | + steps: |
| 126 | + - name: Free disk space |
| 127 | + |
| 128 | + with: |
| 129 | + tool-cache: false |
| 130 | + docker-images: false |
| 131 | + |
| 132 | + - name: Set up JDK ${{ env.JAVA_DISTRIBUTION }}/${{ env.JAVA_VERSION }} |
| 133 | + uses: actions/setup-java@v4 |
| 134 | + with: |
| 135 | + java-version: ${{ env.JAVA_VERSION }} |
| 136 | + distribution: ${{ env.JAVA_DISTRIBUTION }} |
| 137 | + |
| 138 | + - name: Checkout |
| 139 | + uses: actions/checkout@v4 |
| 140 | + |
| 141 | + - name: Get presto release version |
| 142 | + run: | |
| 143 | + PRESTO_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \ |
| 144 | + -Dexpression=project.version -q -ntp -DforceStdout | tail -n 1) |
| 145 | + echo "RELEASE_TAG=$PRESTO_VERSION" >> $GITHUB_ENV |
| 146 | +
|
| 147 | + - name: Initialize prestissimo submodules |
| 148 | + working-directory: presto-native-execution |
| 149 | + run: | |
| 150 | + df -h |
| 151 | + cd ${{ github.workspace }}/presto-native-execution && make submodules |
| 152 | + echo "COMMIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV |
| 153 | +
|
| 154 | + - name: Login to dockerHub |
| 155 | + uses: docker/login-action@v3 |
| 156 | + with: |
| 157 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 158 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 159 | + |
| 160 | + - name: Build ubuntu dependency image |
| 161 | + working-directory: presto-native-execution |
| 162 | + run: | |
| 163 | + df -h |
| 164 | + if [[ -n "${{ github.event.inputs.prebuild_ubuntu_dependency_image }}" ]]; then |
| 165 | + echo "Pulling prebuilt Ubuntu dependency image: ${{ github.event.inputs.prebuild_ubuntu_dependency_image }}" |
| 166 | + docker pull ${{ github.event.inputs.prebuild_ubuntu_dependency_image }} |
| 167 | + docker tag ${{ github.event.inputs.prebuild_ubuntu_dependency_image }} presto/prestissimo-dependency:ubuntu-22.04 |
| 168 | + else |
| 169 | + docker compose build ubuntu-native-dependency |
| 170 | + docker tag presto/prestissimo-dependency:ubuntu-22.04 ${{ github.repository_owner }}/presto-ubuntu-dependency:${{ env.RELEASE_TAG }}-${{ env.COMMIT_SHA }} |
| 171 | + docker push ${{ github.repository_owner }}/presto-ubuntu-dependency:${{ env.RELEASE_TAG }}-${{ env.COMMIT_SHA }} |
| 172 | + if [[ "${{ github.event.inputs.tag_image_as_latest }}" == "true" ]]; then |
| 173 | + docker tag presto/prestissimo-dependency:ubuntu-22.04 ${{ github.repository_owner }}/presto-ubuntu-dependency:latest |
| 174 | + docker push ${{ github.repository_owner }}/presto-ubuntu-dependency:latest |
| 175 | + fi |
| 176 | + fi |
| 177 | + docker images |
| 178 | +
|
| 179 | + - name: Build ubuntu dev Image |
| 180 | + if: ${{ github.event.inputs.publish_ubuntu_image }} |
| 181 | + working-directory: docker |
| 182 | + run: | |
| 183 | + df -h |
| 184 | + docker compose build ubuntu-dev |
| 185 | + docker images |
| 186 | +
|
| 187 | + - name: Publish ubuntu dev images |
| 188 | + if: ${{ github.event.inputs.publish_ubuntu_image }} |
| 189 | + working-directory: docker |
| 190 | + run: | |
| 191 | + df -h |
| 192 | + docker tag presto/presto-dev:ubuntu-22.04 ${{ env.ORG_NAME }}/presto-ubuntu-dev:${{env.RELEASE_TAG }} |
| 193 | + docker push ${{ env.ORG_NAME }}/presto-ubuntu-dev:${{ env.RELEASE_TAG }} |
| 194 | + if [[ "${{ github.event.inputs.tag_image_as_latest }}" == "true" ]]; then |
| 195 | + docker tag presto/presto-dev:ubuntu-22.04 ${{ env.ORG_NAME }}/presto-ubuntu-dev:latest |
| 196 | + docker push ${{ env.ORG_NAME }}/presto-ubuntu-dev:latest |
| 197 | + fi |
| 198 | + docker images |
0 commit comments