diff --git a/.github/workflows/docker-gpu.yaml b/.github/workflows/docker-gpu.yaml new file mode 100644 index 00000000..74ceeb5a --- /dev/null +++ b/.github/workflows/docker-gpu.yaml @@ -0,0 +1,85 @@ +name: Docker GPU Image + +on: + push: + branches: + - master + tags: + - v* + # Limited to the paths that can break these images and are not covered by + # the CPU image's PR build. + pull_request: + paths: + - Dockerfile.gpu + - Dockerfile.gpu.intel + - install_deps.sh + - node.sh + - .github/workflows/docker-gpu.yaml + workflow_dispatch: + +permissions: + contents: read + id-token: write + +concurrency: + group: docker-gpu-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + gpu: + uses: docker/github-builder/.github/workflows/build.yml@v1 + with: + output: image + # Only refs that produce tags may push: a workflow_dispatch on any other + # branch would otherwise push untagged digests and then fail. + push: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }} + file: ./Dockerfile.gpu + platforms: linux/amd64 + set-meta-labels: true + meta-images: opendronemap/nodeodm + meta-flavor: | + latest=false + suffix=-gpu + # :edge-gpu on master; :-gpu and :gpu on a v* tag. The '-' + # guard keeps prereleases (v3.7.0-rc1) off :gpu. + meta-tags: | + type=edge,branch=master + type=semver,pattern={{version}} + type=ref,event=pr + type=raw,value=gpu,suffix=,enable=${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-') }} + secrets: + registry-auths: | + - registry: docker.io + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + # The Intel image layers OpenCL packages on the GPU image built above, so it + # builds from that image's digest rather than racing the :gpu tag. It only + # runs on refs that pushed a GPU image. + gpu-intel: + needs: gpu + if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }} + uses: docker/github-builder/.github/workflows/build.yml@v1 + with: + output: image + push: true + file: ./Dockerfile.gpu.intel + platforms: linux/amd64 + build-args: | + FROM_REPO=opendronemap/nodeodm@${{ needs.gpu.outputs.digest }} + set-meta-labels: true + meta-images: opendronemap/nodeodm + meta-flavor: | + latest=false + suffix=-gpu-intel + # :edge-gpu-intel on master; :-gpu-intel and :gpu-intel on a + # v* tag. The pre-3.6.2 :gpu.intel spelling is not carried forward. + meta-tags: | + type=edge,branch=master + type=semver,pattern={{version}} + type=raw,value=gpu-intel,suffix=,enable=${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-') }} + secrets: + registry-auths: | + - registry: docker.io + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml new file mode 100644 index 00000000..a7ea627d --- /dev/null +++ b/.github/workflows/docker.yaml @@ -0,0 +1,44 @@ +name: Docker CPU Image + +on: + push: + branches: + - master + tags: + - v* + pull_request: + workflow_dispatch: + +permissions: + contents: read + id-token: write + +concurrency: + group: docker-cpu-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + cpu: + uses: docker/github-builder/.github/workflows/build.yml@v1 + with: + output: image + # Only refs that produce tags may push: a workflow_dispatch on any other + # branch would otherwise push untagged digests and then fail. + push: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }} + file: ./Dockerfile + platforms: | + linux/amd64 + linux/arm64 + set-meta-labels: true + meta-images: opendronemap/nodeodm + # :edge on master; : and :latest on a v* tag (latest=auto + # skips prereleases such as v3.7.0-rc1). + meta-tags: | + type=edge,branch=master + type=semver,pattern={{version}} + type=ref,event=pr + secrets: + registry-auths: | + - registry: docker.io + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/publish-docker-gpu-intel.yaml b/.github/workflows/publish-docker-gpu-intel.yaml deleted file mode 100644 index 25b132f1..00000000 --- a/.github/workflows/publish-docker-gpu-intel.yaml +++ /dev/null @@ -1,44 +0,0 @@ -name: Publish Docker Intel GPU - -on: - push: - branches: - - master - tags: - - v* - - # Triggered by ODM build (after docker push) - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - # Use the repository information of the checked-out code to format docker tags - - name: Docker meta - id: docker_meta - uses: crazy-max/ghaction-docker-meta@v1 - with: - images: opendronemap/nodeodm - tag-semver: | - {{version}} - - name: Build and push Docker image - id: docker_build - uses: docker/build-push-action@v2 - with: - file: ./Dockerfile.gpu.intel - platforms: linux/amd64 - push: true - tags: | - opendronemap/nodeodm:gpu.intel \ No newline at end of file diff --git a/.github/workflows/publish-docker-gpu.yaml b/.github/workflows/publish-docker-gpu.yaml deleted file mode 100644 index 376bc42f..00000000 --- a/.github/workflows/publish-docker-gpu.yaml +++ /dev/null @@ -1,44 +0,0 @@ -name: Publish Docker GPU - -on: - push: - branches: - - master - tags: - - v* - - # Triggered by ODM build (after docker push) - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - # Use the repository information of the checked-out code to format docker tags - - name: Docker meta - id: docker_meta - uses: crazy-max/ghaction-docker-meta@v1 - with: - images: opendronemap/nodeodm - tag-semver: | - {{version}} - - name: Build and push Docker image - id: docker_build - uses: docker/build-push-action@v2 - with: - file: ./Dockerfile.gpu - platforms: linux/amd64 - push: true - tags: | - opendronemap/nodeodm:gpu \ No newline at end of file diff --git a/.github/workflows/publish-docker.yaml b/.github/workflows/publish-docker.yaml deleted file mode 100644 index 26512429..00000000 --- a/.github/workflows/publish-docker.yaml +++ /dev/null @@ -1,47 +0,0 @@ -name: Publish Docker - -on: - push: - branches: - - master - tags: - - v* - - # Triggered by ODM build (after docker push) - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - with: - image: tonistiigi/binfmt:qemu-v7.0.0-28 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - # Use the repository information of the checked-out code to format docker tags - - name: Docker meta - id: docker_meta - uses: crazy-max/ghaction-docker-meta@v1 - with: - images: opendronemap/nodeodm - tag-semver: | - {{version}} - - name: Build and push Docker image - id: docker_build - uses: docker/build-push-action@v2 - with: - file: ./Dockerfile - platforms: linux/amd64,linux/arm64 - push: true - tags: | - ${{ steps.docker_meta.outputs.tags }} - opendronemap/nodeodm:latest diff --git a/.github/workflows/publish-windows.yml b/.github/workflows/publish-windows.yml index 36451d9f..ef0de3b5 100644 --- a/.github/workflows/publish-windows.yml +++ b/.github/workflows/publish-windows.yml @@ -11,15 +11,21 @@ permissions: contents: write id-token: write +# Let a tagged release build run to completion instead of being superseded by a +# later push to the same ref. Different refs (master vs. a tag) never contend. +concurrency: + group: publish-windows-${{ github.ref }} + cancel-in-progress: false + jobs: build: runs-on: windows-latest environment: azuresigning steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v6 - name: Setup NodeJS - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: '14' - name: Setup Env @@ -43,10 +49,12 @@ jobs: npm run winbundle -- --signtool-path "C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64\signtool.exe" --azure-signing-metadata "%RUNNER_TEMP%\metadata.json" shell: cmd - name: Upload Bundle File + if: always() uses: actions/upload-artifact@v4 with: name: Bundle path: dist\*.zip + retention-days: 3 - name: Upload Bundle to Release uses: svenstaro/upload-release-action@v2 if: startsWith(github.ref, 'refs/tags/') diff --git a/.github/workflows/test-build-prs.yml b/.github/workflows/test-build-prs.yml deleted file mode 100644 index 4a0d1d5c..00000000 --- a/.github/workflows/test-build-prs.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Build PRs - -on: - pull_request: - -jobs: - docker: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5000:5000 - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - with: - driver-opts: network=host - - name: Build - uses: docker/build-push-action@v2 - with: - context: . - platforms: linux/amd64 - push: true - tags: localhost:5000/opendronemap/nodeodm:test - - name: Test Powercycle - run: | - docker run --rm localhost:5000/opendronemap/nodeodm:test --powercycle diff --git a/Dockerfile b/Dockerfile index 2ba0b1ab..f42a64db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -FROM opendronemap/odm:3.5.6 -MAINTAINER Piero Toffanin +FROM opendronemap/odm:3.6.2 +LABEL org.opencontainers.image.authors="OpenDroneMap Developers " EXPOSE 3000 diff --git a/Dockerfile.gpu b/Dockerfile.gpu index ee6e07a4..44556811 100644 --- a/Dockerfile.gpu +++ b/Dockerfile.gpu @@ -1,6 +1,6 @@ -ARG FROM_REPO=opendronemap/odm:gpu +ARG FROM_REPO=opendronemap/odm:3.6.2-gpu FROM ${FROM_REPO} -MAINTAINER Piero Toffanin +LABEL org.opencontainers.image.authors="OpenDroneMap Developers " EXPOSE 3000 @@ -19,10 +19,7 @@ RUN bash install_deps.sh && \ ln -s /code/SuperBuild/install/bin/untwine /usr/bin/untwine && \ ln -s /code/SuperBuild/install/bin/entwine /usr/bin/entwine && \ ln -s /code/SuperBuild/install/bin/pdal /usr/bin/pdal && \ - ln -s /var/www/node.sh /usr/bin/node && \ - mkdir -p tmp && node index.js --powercycle - -RUN echo /usr/local/cuda-11.2/compat >> /etc/ld.so.conf.d/989_cuda-11.conf && ldconfig + ln -s /var/www/node.sh /usr/bin/node RUN useradd -m -d "/home/odm" -s /bin/bash odm && \ chown -R odm:odm /var/www && \ @@ -30,4 +27,7 @@ RUN useradd -m -d "/home/odm" -s /bin/bash odm && \ USER odm +# Smoke test as the runtime user, with the command ENTRYPOINT runs. +RUN mkdir -p tmp && /usr/bin/node /var/www/index.js --powercycle + ENTRYPOINT ["/usr/bin/node", "/var/www/index.js"] diff --git a/Dockerfile.gpu.intel b/Dockerfile.gpu.intel index 61b78fde..87993e69 100644 --- a/Dockerfile.gpu.intel +++ b/Dockerfile.gpu.intel @@ -1,4 +1,5 @@ -FROM opendronemap/nodeodm:gpu +ARG FROM_REPO=opendronemap/nodeodm:gpu +FROM ${FROM_REPO} EXPOSE 3000 diff --git a/package.json b/package.json index 816297d6..324018ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "NodeODM", - "version": "2.2.4", + "version": "3.6.2", "description": "REST API to access ODM", "main": "index.js", "scripts": {