From 959b2ec8784f038747cbcf9873f3a106bf01a386 Mon Sep 17 00:00:00 2001 From: Ethan Date: Tue, 5 Dec 2023 10:36:36 -0800 Subject: [PATCH 1/2] Added new workflow --- .github/workflows/ghcr.yml | 36 +++++++++++++++++++ .../industrial_data_simulator_ghcr.yml | 12 +++++++ samples/industrial-data-simulator/Dockerfile | 3 ++ samples/industrial-data-simulator/README.md | 2 +- 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ghcr.yml create mode 100644 .github/workflows/industrial_data_simulator_ghcr.yml diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml new file mode 100644 index 0000000..3ac2df1 --- /dev/null +++ b/.github/workflows/ghcr.yml @@ -0,0 +1,36 @@ +name: deploy_ghcr + +on: + workflow_call: + inputs: + file: + required: true + type: string + context: + required: true + type: string + name: + required: true + type: string + +jobs: + push-store-image: + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - name: "Checkout GitHub Action" + uses: actions/checkout@main + + - name: "Login to GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{github.actor}} + password: ${{secrets.GITHUB_TOKEN}} + + - name: "Build Inventory Image" + run: | + docker build ${{ inputs.context }} -f ${{ inputs.file }} --tag ghcr.io/azure-samples/explore-iot-operations/${{ inputs.name }}:latest + docker push ghcr.io/azure-samples/explore-iot-operations/${{ inputs.name }}:latest diff --git a/.github/workflows/industrial_data_simulator_ghcr.yml b/.github/workflows/industrial_data_simulator_ghcr.yml new file mode 100644 index 0000000..537398a --- /dev/null +++ b/.github/workflows/industrial_data_simulator_ghcr.yml @@ -0,0 +1,12 @@ +name: industrial_data_simulator_ghcr + +on: + workflow_dispatch: + +jobs: + call-docker-build: + uses: ./.github/workflows/ghcr.yml + with: + name: industrial-data-simulator + file: samples/industrial-data-simulator/Dockerfile + context: . \ No newline at end of file diff --git a/samples/industrial-data-simulator/Dockerfile b/samples/industrial-data-simulator/Dockerfile index cbf0dbe..e52860e 100644 --- a/samples/industrial-data-simulator/Dockerfile +++ b/samples/industrial-data-simulator/Dockerfile @@ -1,6 +1,9 @@ # syntax=docker/dockerfile:1 FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21-cbl-mariner2.0 AS build +LABEL org.opencontainers.image.source=https://github.com/Azure-Samples/explore-iot-operations +LABEL org.opencontainers.image.description="Industrial data simulator" +LABEL org.opencontainers.image.licenses=MIT COPY ./lib /workdir/lib diff --git a/samples/industrial-data-simulator/README.md b/samples/industrial-data-simulator/README.md index fd641f8..7c0d965 100644 --- a/samples/industrial-data-simulator/README.md +++ b/samples/industrial-data-simulator/README.md @@ -30,7 +30,7 @@ docker build ../.. -f Dockerfile -t makocr.azurecr.io/industrial-data-simulator: kubectl apply -f manifest.yml ``` -Industrial Data simulator runs as a pod within the desired cluster using the kubectl apply command with the provided manifest file (`./manifest.yml`). The configuration is passed as a config mapping in the kubernetes manifest, and can be altered to produce the desired simulation (see configmap at top of manifest file). +Industrial Data simulator runs as a pod within the desired cluster using the kubectl run command. The configuration of choice is provided via stdin of the simulator process within the pod, provided in the command above using `--stdin < config.yml`. Alternative names for a configuration file may be used -- the command simply uses stdin piping to provide simulator with an appropriate configuration. See the example YAML configuration below, with comments describing the various configurable fields. From c70e63443cb90a791153dd069e61c63379039148 Mon Sep 17 00:00:00 2001 From: Ethan Date: Tue, 5 Dec 2023 10:39:17 -0800 Subject: [PATCH 2/2] Revert change in readme --- samples/industrial-data-simulator/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/industrial-data-simulator/README.md b/samples/industrial-data-simulator/README.md index 7c0d965..fd641f8 100644 --- a/samples/industrial-data-simulator/README.md +++ b/samples/industrial-data-simulator/README.md @@ -30,7 +30,7 @@ docker build ../.. -f Dockerfile -t makocr.azurecr.io/industrial-data-simulator: kubectl apply -f manifest.yml ``` -Industrial Data simulator runs as a pod within the desired cluster using the kubectl run command. The configuration of choice is provided via stdin of the simulator process within the pod, provided in the command above using `--stdin < config.yml`. Alternative names for a configuration file may be used -- the command simply uses stdin piping to provide simulator with an appropriate configuration. +Industrial Data simulator runs as a pod within the desired cluster using the kubectl apply command with the provided manifest file (`./manifest.yml`). The configuration is passed as a config mapping in the kubernetes manifest, and can be altered to produce the desired simulation (see configmap at top of manifest file). See the example YAML configuration below, with comments describing the various configurable fields.