From 7b39b1c8fc051cd619eefb85a2d0b0e787343a69 Mon Sep 17 00:00:00 2001 From: Marc Hanheide Date: Fri, 20 Sep 2024 11:58:09 +0100 Subject: [PATCH 1/2] switch to pre-build image --- .devcontainer/cuda-opengl/devcontainer.json | 22 ++++++++++----------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.devcontainer/cuda-opengl/devcontainer.json b/.devcontainer/cuda-opengl/devcontainer.json index 28e1870..37979e4 100644 --- a/.devcontainer/cuda-opengl/devcontainer.json +++ b/.devcontainer/cuda-opengl/devcontainer.json @@ -1,17 +1,15 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu { - "name": "L-CAS Humble CUDA-OpenGL Devcontainer", - // Use the below image to not build locally (pushed by GitHub Action) - // disable the "build" section below in this case - // "image": "lcas.lincoln.ac.uk/devcontainer/lcas/rob2002:cuda-opengl-main", - "build": { - "dockerfile": "../Dockerfile", - "args": { - "BASE_IMAGE": "lcas.lincoln.ac.uk/lcas/ros:jammy-humble-cuda12.2-opengl" - }, - "context": "../.." - }, + "name": "L-CAS Humble CUDA-OpenGL ROB2002 Devcontainer", + "image": "lcas.lincoln.ac.uk/devcontainer/lcas/rob2002:cuda-opengl-deployment", + //"build": { + // "dockerfile": "../Dockerfile", + // "args": { + // "BASE_IMAGE": "lcas.lincoln.ac.uk/lcas/ros:jammy-humble-cuda12.2-opengl" + // }, + // "context": "../.." + //}, "forwardPorts": [5801], "portsAttributes": { @@ -46,4 +44,4 @@ "cpus": 2, "memory": "6gb" } -} \ No newline at end of file +} From 770679cb30f0c29fd9030727c7a78ce721a23213 Mon Sep 17 00:00:00 2001 From: Marc Hanheide Date: Fri, 20 Sep 2024 12:02:50 +0100 Subject: [PATCH 2/2] remove possibility to push from the main branch and make the dev container CI job just a test --- .github/workflows/dev-container.yml | 35 +---------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/.github/workflows/dev-container.yml b/.github/workflows/dev-container.yml index 7bfa1ab..84feea8 100644 --- a/.github/workflows/dev-container.yml +++ b/.github/workflows/dev-container.yml @@ -1,6 +1,5 @@ name: 'devcontainer CI' on: - workflow_dispatch: pull_request: branches: - main @@ -12,19 +11,12 @@ on: jobs: build_devcontainer: - # only run for LCAS repositories - if: github.repository_owner == 'LCAS' || github.repository_owner == 'lcas' - runs-on: lcas + runs-on: ubuntu-latest strategy: matrix: config: - cuda-opengl steps: - - name: Node Js - uses: actions/setup-node@v4 - with: - node-version: "^16.13.0 || >=18.0.0" - - name: Checkout from github uses: actions/checkout@v3 - name: extract the github reference @@ -32,23 +24,7 @@ jobs: - name: "image name from repo name" id: docker_image_name run: echo "docker_image=${{ github.repository }}" | tr '[:upper:]' '[:lower:]' |sed 's/[^0-9,a-z,A-Z,=,_,\/]/-/g' >>${GITHUB_OUTPUT} - - - name: Docker Login LCAS - # don't attempt to login for PRs - if: ${{ github.event_name != 'pull_request' }} - # You may pin to the exact commit or the version. - # uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - uses: docker/login-action@v2 - with: - # Server address of Docker registry. If not set then will default to Docker Hub - registry: lcas.lincoln.ac.uk - # Username used to log against the Docker registry - username: ${{ secrets.LCAS_REGISTRY_PUSHER }} - # Password or personal access token used to log against the Docker registry - password: ${{ secrets.LCAS_REGISTRY_TOKEN }} - - name: Build dev container task - if: ${{ github.event_name == 'pull_request' }} uses: devcontainers/ci@v0.3 with: imageName: lcas.lincoln.ac.uk/devcontainer/${{ steps.docker_image_name.outputs.docker_image }} @@ -56,12 +32,3 @@ jobs: push: never imageTag: ${{ matrix.config }}-${{ env.BRANCH }} #runCmd: "bash .devcontainer/run-ci.sh" - - name: Build and push dev container image - if: ${{ github.event_name != 'pull_request' }} - uses: devcontainers/ci@v0.3 - with: - imageName: lcas.lincoln.ac.uk/devcontainer/${{ steps.docker_image_name.outputs.docker_image }} - configFile: ./.devcontainer/${{ matrix.config }}/devcontainer.json - push: always - imageTag: ${{ matrix.config }}-${{ env.BRANCH }} - #runCmd: "bash .devcontainer/run-ci.sh" \ No newline at end of file