From 410392527eb49ab7d5ddd2906c50c4c1689f5b36 Mon Sep 17 00:00:00 2001 From: Lachlan Heywood Date: Mon, 23 Oct 2023 10:21:44 -0400 Subject: [PATCH] feat(mcc): update pipeline --- .github/workflows/build-multichannelchat.yml | 6 +- .../workflows/release-multichannelchat.yml | 64 ++++++++----------- multi-channel-chat/README.md | 6 +- .../.cargo/config.toml | 0 .../.github/workflows/build.yml | 0 .../.github/workflows/release.yml | 0 .../{api-gateway => apigateway}/.gitignore | 0 .../{api-gateway => apigateway}/Cargo.lock | 0 .../{api-gateway => apigateway}/Cargo.toml | 0 .../{api-gateway => apigateway}/README.md | 0 .../{api-gateway => apigateway}/build.rs | 0 .../{api-gateway => apigateway}/codegen.toml | 0 .../src/chatlog.rs | 0 .../{api-gateway => apigateway}/src/lib.rs | 0 .../src/outbound.rs | 0 .../wasmcloud.toml | 0 .../.cargo/config.toml | 0 .../.github/workflows/build.yml | 0 .../.github/workflows/release.yml | 0 .../{http-channel => httpchannel}/.gitignore | 0 .../{http-channel => httpchannel}/Cargo.lock | 0 .../{http-channel => httpchannel}/Cargo.toml | 0 .../{http-channel => httpchannel}/README.md | 0 .../{http-channel => httpchannel}/build.rs | 0 .../codegen.toml | 0 .../src/chatlog.rs | 0 .../{http-channel => httpchannel}/src/lib.rs | 0 .../src/outbound.rs | 0 .../wasmcloud.toml | 0 .../multi-channel-chat.wadm.yaml | 1 + .../.cargo/config.toml | 0 .../.github/workflows/build.yml | 0 .../.github/workflows/release.yml | 0 .../{nats-channel => natschannel}/.gitignore | 0 .../{nats-channel => natschannel}/Cargo.lock | 0 .../{nats-channel => natschannel}/Cargo.toml | 0 .../{nats-channel => natschannel}/README.md | 0 .../{nats-channel => natschannel}/build.rs | 0 .../codegen.toml | 0 .../src/chatlog.rs | 0 .../{nats-channel => natschannel}/src/lib.rs | 0 .../src/outbound.rs | 0 .../wasmcloud.toml | 0 43 files changed, 33 insertions(+), 44 deletions(-) rename multi-channel-chat/{api-gateway => apigateway}/.cargo/config.toml (100%) rename multi-channel-chat/{api-gateway => apigateway}/.github/workflows/build.yml (100%) rename multi-channel-chat/{api-gateway => apigateway}/.github/workflows/release.yml (100%) rename multi-channel-chat/{api-gateway => apigateway}/.gitignore (100%) rename multi-channel-chat/{api-gateway => apigateway}/Cargo.lock (100%) rename multi-channel-chat/{api-gateway => apigateway}/Cargo.toml (100%) rename multi-channel-chat/{api-gateway => apigateway}/README.md (100%) rename multi-channel-chat/{api-gateway => apigateway}/build.rs (100%) rename multi-channel-chat/{api-gateway => apigateway}/codegen.toml (100%) rename multi-channel-chat/{api-gateway => apigateway}/src/chatlog.rs (100%) rename multi-channel-chat/{api-gateway => apigateway}/src/lib.rs (100%) rename multi-channel-chat/{api-gateway => apigateway}/src/outbound.rs (100%) rename multi-channel-chat/{api-gateway => apigateway}/wasmcloud.toml (100%) rename multi-channel-chat/{http-channel => httpchannel}/.cargo/config.toml (100%) rename multi-channel-chat/{http-channel => httpchannel}/.github/workflows/build.yml (100%) rename multi-channel-chat/{http-channel => httpchannel}/.github/workflows/release.yml (100%) rename multi-channel-chat/{http-channel => httpchannel}/.gitignore (100%) rename multi-channel-chat/{http-channel => httpchannel}/Cargo.lock (100%) rename multi-channel-chat/{http-channel => httpchannel}/Cargo.toml (100%) rename multi-channel-chat/{http-channel => httpchannel}/README.md (100%) rename multi-channel-chat/{http-channel => httpchannel}/build.rs (100%) rename multi-channel-chat/{http-channel => httpchannel}/codegen.toml (100%) rename multi-channel-chat/{http-channel => httpchannel}/src/chatlog.rs (100%) rename multi-channel-chat/{http-channel => httpchannel}/src/lib.rs (100%) rename multi-channel-chat/{http-channel => httpchannel}/src/outbound.rs (100%) rename multi-channel-chat/{http-channel => httpchannel}/wasmcloud.toml (100%) create mode 100644 multi-channel-chat/multi-channel-chat.wadm.yaml rename multi-channel-chat/{nats-channel => natschannel}/.cargo/config.toml (100%) rename multi-channel-chat/{nats-channel => natschannel}/.github/workflows/build.yml (100%) rename multi-channel-chat/{nats-channel => natschannel}/.github/workflows/release.yml (100%) rename multi-channel-chat/{nats-channel => natschannel}/.gitignore (100%) rename multi-channel-chat/{nats-channel => natschannel}/Cargo.lock (100%) rename multi-channel-chat/{nats-channel => natschannel}/Cargo.toml (100%) rename multi-channel-chat/{nats-channel => natschannel}/README.md (100%) rename multi-channel-chat/{nats-channel => natschannel}/build.rs (100%) rename multi-channel-chat/{nats-channel => natschannel}/codegen.toml (100%) rename multi-channel-chat/{nats-channel => natschannel}/src/chatlog.rs (100%) rename multi-channel-chat/{nats-channel => natschannel}/src/lib.rs (100%) rename multi-channel-chat/{nats-channel => natschannel}/src/outbound.rs (100%) rename multi-channel-chat/{nats-channel => natschannel}/wasmcloud.toml (100%) diff --git a/.github/workflows/build-multichannelchat.yml b/.github/workflows/build-multichannelchat.yml index 2303db1..fe2527e 100644 --- a/.github/workflows/build-multichannelchat.yml +++ b/.github/workflows/build-multichannelchat.yml @@ -14,10 +14,10 @@ jobs: fail-fast: false matrix: working-directory: - - multi-channel-chat/api-gateway + - multi-channel-chat/apigateway - multi-channel-chat/chatlog - - multi-channel-chat/http-channel - - multi-channel-chat/nats-channel + - multi-channel-chat/httpchannel + - multi-channel-chat/natschannel steps: - uses: actions/checkout@v3 - name: Add wasm32-unknown-unknown diff --git a/.github/workflows/release-multichannelchat.yml b/.github/workflows/release-multichannelchat.yml index 7887bd6..23799ba 100644 --- a/.github/workflows/release-multichannelchat.yml +++ b/.github/workflows/release-multichannelchat.yml @@ -16,37 +16,31 @@ jobs: fail-fast: false matrix: working-directory: - - multi-channel-chat/api-gateway + - multi-channel-chat/apigateway - multi-channel-chat/chatlog - - multi-channel-chat/http-channel - - multi-channel-chat/nats-channel + - multi-channel-chat/httpchannel + - multi-channel-chat/natschannel include: - - working-directory: multi-channel-chat/api-gateway - artifact-name: api-gateway + - working-directory: multi-channel-chat/apigateway + artifact-name: apigateway + wash-key: AWESOME_COSMONIC_MCC_APIGATEWAY_KEY - working-directory: multi-channel-chat/chatlog artifact-name: chatlog - - working-directory: multi-channel-chat/http-channel - artifact-name: http-channel - - working-directory: multi-channel-chat/nats-channel - artifact-name: nats-channel + wash-key: AWESOME_COSMONIC_MCC_CHATLOG_KEY + - working-directory: multi-channel-chat/httpchannel + artifact-name: httpchannel + wash-key: AWESOME_COSMONIC_MCC_HTTPCHANNEL_KEY + - working-directory: multi-channel-chat/natschannel + artifact-name: natschannel + wash-key: AWESOME_COSMONIC_MCC_NATSCHANNEL_KEY steps: - uses: actions/checkout@v3 - uses: wasmcloud/common-actions/install-wash@main - name: Add wasm32-unknown-unknown run: rustup target add wasm32-unknown-unknown - - name: Set wash subject key (api-gateway) - if: ${{ matrix.artifact-name == 'api-gateway' }} - run: echo "WASH_SUBJECT_KEY=${{ secrets.AWESOME_COSMONIC_MCC_APIGATEWAY_KEY }}" > $GITHUB_ENV - - name: Set wash subject key (chatlog) - if: ${{ matrix.artifact-name == 'chatlog' }} - run: echo "WASH_SUBJECT_KEY=${{ secrets.AWESOME_COSMONIC_MCC_CHATLOG_KEY }}" > $GITHUB_ENV - - name: Set wash subject key (http-channel) - if: ${{ matrix.artifact-name == 'http-channel' }} - run: echo "WASH_SUBJECT_KEY=${{ secrets.AWESOME_COSMONIC_MCC_HTTPCHANNEL_KEY }}" > $GITHUB_ENV - - name: Set wash subject key (nats-channel) - if: ${{ matrix.artifact-name == 'nats-channel' }} - run: echo "WASH_SUBJECT_KEY=${{ secrets.AWESOME_COSMONIC_MCC_NATSCHANNEL_KEY }}" > $GITHUB_ENV + - name: Set wash subject key + run: echo "WASH_SUBJECT_KEY=${{ secrets[matrix.wash-key] }}" > $GITHUB_ENV - name: Build and sign wasmCloud actor env: @@ -68,19 +62,19 @@ jobs: fail-fast: false matrix: working-directory: - - multi-channel-chat/api-gateway + - multi-channel-chat/apigateway - multi-channel-chat/chatlog - - multi-channel-chat/http-channel - - multi-channel-chat/nats-channel + - multi-channel-chat/httpchannel + - multi-channel-chat/natschannel include: - - working-directory: multi-channel-chat/api-gateway - artifact-name: api-gateway + - working-directory: multi-channel-chat/apigateway + artifact-name: apigateway - working-directory: multi-channel-chat/chatlog artifact-name: chatlog - - working-directory: multi-channel-chat/http-channel - artifact-name: http-channel - - working-directory: multi-channel-chat/nats-channel - artifact-name: nats-channel + - working-directory: multi-channel-chat/httpchannel + artifact-name: httpchannel + - working-directory: multi-channel-chat/natschannel + artifact-name: natschannel steps: - uses: actions/checkout@v3 - uses: wasmcloud/common-actions/install-wash@main @@ -94,21 +88,15 @@ jobs: echo "actor-name=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[].name')" >> $GITHUB_ENV working-directory: ${{ matrix.working-directory }} - name: Determine actor version - if: startswith(github.ref, 'refs/tags/') # Only run on tag push run: | echo "actor-version=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[].version')" >> $GITHUB_ENV working-directory: ${{ matrix.working-directory }} - - name: Determine actor version (main) - if: ${{ !startswith(github.ref, 'refs/tags/') }} - run: | - echo "actor-version=latest" >> $GITHUB_ENV - working-directory: ${{ matrix.working-directory }} - name: Push actor to AzureCR uses: wasmcloud/common-actions/oci-artifact-release@main with: artifact-path: ${{ matrix.working-directory }}/build/${{ env.actor-name }}_s.wasm - oci-url: ${{ secrets.AZURECR_PUSH_URL }} - oci-repository: ${{ env.actor-name }} + oci-url: ${{ secrets.AZURECR_PUSH_URL }} + oci-repository: mcc_${{ env.actor-name }} oci-version: ${{ env.actor-version }} oci-username: ${{ secrets.COSMONIC_AZURECR_PUSH_USER }} oci-password: ${{ secrets.COSMONIC_AZURECR_PUSH_PASSWORD }} \ No newline at end of file diff --git a/multi-channel-chat/README.md b/multi-channel-chat/README.md index c963fbd..bd75bf8 100644 --- a/multi-channel-chat/README.md +++ b/multi-channel-chat/README.md @@ -6,9 +6,9 @@ For the full guide and walkthrough for this application, check out the relevant ## Components The chat application is made up of the following components (_all of which are actors_): -* [API Gateway](./api-gateway/README.md) - The API gateway used by all channels +* [API Gateway](./apigateway/README.md) - The API gateway used by all channels * [Chatlog](./chatlog/README.md) - The chat log actor, performs read/write operations on message storage -* [HTTP Channel](./http-channel/README.md) - The HTTP channel actor. Accepts HTTP requests and relays them to the API gateway -* [NATS Channel](./nats-channel/README.md) - The NATS channel actor. Accepts new message requests and publishes messages as they arrive in real-time +* [HTTP Channel](./httpchannel/README.md) - The HTTP channel actor. Accepts HTTP requests and relays them to the API gateway +* [NATS Channel](./natschannel/README.md) - The NATS channel actor. Accepts new message requests and publishes messages as they arrive in real-time The shared schema definition for the `Outbound` service definition and the `Chatlog` service definition can be found in the [interface](./interface/README.md) directory. \ No newline at end of file diff --git a/multi-channel-chat/api-gateway/.cargo/config.toml b/multi-channel-chat/apigateway/.cargo/config.toml similarity index 100% rename from multi-channel-chat/api-gateway/.cargo/config.toml rename to multi-channel-chat/apigateway/.cargo/config.toml diff --git a/multi-channel-chat/api-gateway/.github/workflows/build.yml b/multi-channel-chat/apigateway/.github/workflows/build.yml similarity index 100% rename from multi-channel-chat/api-gateway/.github/workflows/build.yml rename to multi-channel-chat/apigateway/.github/workflows/build.yml diff --git a/multi-channel-chat/api-gateway/.github/workflows/release.yml b/multi-channel-chat/apigateway/.github/workflows/release.yml similarity index 100% rename from multi-channel-chat/api-gateway/.github/workflows/release.yml rename to multi-channel-chat/apigateway/.github/workflows/release.yml diff --git a/multi-channel-chat/api-gateway/.gitignore b/multi-channel-chat/apigateway/.gitignore similarity index 100% rename from multi-channel-chat/api-gateway/.gitignore rename to multi-channel-chat/apigateway/.gitignore diff --git a/multi-channel-chat/api-gateway/Cargo.lock b/multi-channel-chat/apigateway/Cargo.lock similarity index 100% rename from multi-channel-chat/api-gateway/Cargo.lock rename to multi-channel-chat/apigateway/Cargo.lock diff --git a/multi-channel-chat/api-gateway/Cargo.toml b/multi-channel-chat/apigateway/Cargo.toml similarity index 100% rename from multi-channel-chat/api-gateway/Cargo.toml rename to multi-channel-chat/apigateway/Cargo.toml diff --git a/multi-channel-chat/api-gateway/README.md b/multi-channel-chat/apigateway/README.md similarity index 100% rename from multi-channel-chat/api-gateway/README.md rename to multi-channel-chat/apigateway/README.md diff --git a/multi-channel-chat/api-gateway/build.rs b/multi-channel-chat/apigateway/build.rs similarity index 100% rename from multi-channel-chat/api-gateway/build.rs rename to multi-channel-chat/apigateway/build.rs diff --git a/multi-channel-chat/api-gateway/codegen.toml b/multi-channel-chat/apigateway/codegen.toml similarity index 100% rename from multi-channel-chat/api-gateway/codegen.toml rename to multi-channel-chat/apigateway/codegen.toml diff --git a/multi-channel-chat/api-gateway/src/chatlog.rs b/multi-channel-chat/apigateway/src/chatlog.rs similarity index 100% rename from multi-channel-chat/api-gateway/src/chatlog.rs rename to multi-channel-chat/apigateway/src/chatlog.rs diff --git a/multi-channel-chat/api-gateway/src/lib.rs b/multi-channel-chat/apigateway/src/lib.rs similarity index 100% rename from multi-channel-chat/api-gateway/src/lib.rs rename to multi-channel-chat/apigateway/src/lib.rs diff --git a/multi-channel-chat/api-gateway/src/outbound.rs b/multi-channel-chat/apigateway/src/outbound.rs similarity index 100% rename from multi-channel-chat/api-gateway/src/outbound.rs rename to multi-channel-chat/apigateway/src/outbound.rs diff --git a/multi-channel-chat/api-gateway/wasmcloud.toml b/multi-channel-chat/apigateway/wasmcloud.toml similarity index 100% rename from multi-channel-chat/api-gateway/wasmcloud.toml rename to multi-channel-chat/apigateway/wasmcloud.toml diff --git a/multi-channel-chat/http-channel/.cargo/config.toml b/multi-channel-chat/httpchannel/.cargo/config.toml similarity index 100% rename from multi-channel-chat/http-channel/.cargo/config.toml rename to multi-channel-chat/httpchannel/.cargo/config.toml diff --git a/multi-channel-chat/http-channel/.github/workflows/build.yml b/multi-channel-chat/httpchannel/.github/workflows/build.yml similarity index 100% rename from multi-channel-chat/http-channel/.github/workflows/build.yml rename to multi-channel-chat/httpchannel/.github/workflows/build.yml diff --git a/multi-channel-chat/http-channel/.github/workflows/release.yml b/multi-channel-chat/httpchannel/.github/workflows/release.yml similarity index 100% rename from multi-channel-chat/http-channel/.github/workflows/release.yml rename to multi-channel-chat/httpchannel/.github/workflows/release.yml diff --git a/multi-channel-chat/http-channel/.gitignore b/multi-channel-chat/httpchannel/.gitignore similarity index 100% rename from multi-channel-chat/http-channel/.gitignore rename to multi-channel-chat/httpchannel/.gitignore diff --git a/multi-channel-chat/http-channel/Cargo.lock b/multi-channel-chat/httpchannel/Cargo.lock similarity index 100% rename from multi-channel-chat/http-channel/Cargo.lock rename to multi-channel-chat/httpchannel/Cargo.lock diff --git a/multi-channel-chat/http-channel/Cargo.toml b/multi-channel-chat/httpchannel/Cargo.toml similarity index 100% rename from multi-channel-chat/http-channel/Cargo.toml rename to multi-channel-chat/httpchannel/Cargo.toml diff --git a/multi-channel-chat/http-channel/README.md b/multi-channel-chat/httpchannel/README.md similarity index 100% rename from multi-channel-chat/http-channel/README.md rename to multi-channel-chat/httpchannel/README.md diff --git a/multi-channel-chat/http-channel/build.rs b/multi-channel-chat/httpchannel/build.rs similarity index 100% rename from multi-channel-chat/http-channel/build.rs rename to multi-channel-chat/httpchannel/build.rs diff --git a/multi-channel-chat/http-channel/codegen.toml b/multi-channel-chat/httpchannel/codegen.toml similarity index 100% rename from multi-channel-chat/http-channel/codegen.toml rename to multi-channel-chat/httpchannel/codegen.toml diff --git a/multi-channel-chat/http-channel/src/chatlog.rs b/multi-channel-chat/httpchannel/src/chatlog.rs similarity index 100% rename from multi-channel-chat/http-channel/src/chatlog.rs rename to multi-channel-chat/httpchannel/src/chatlog.rs diff --git a/multi-channel-chat/http-channel/src/lib.rs b/multi-channel-chat/httpchannel/src/lib.rs similarity index 100% rename from multi-channel-chat/http-channel/src/lib.rs rename to multi-channel-chat/httpchannel/src/lib.rs diff --git a/multi-channel-chat/http-channel/src/outbound.rs b/multi-channel-chat/httpchannel/src/outbound.rs similarity index 100% rename from multi-channel-chat/http-channel/src/outbound.rs rename to multi-channel-chat/httpchannel/src/outbound.rs diff --git a/multi-channel-chat/http-channel/wasmcloud.toml b/multi-channel-chat/httpchannel/wasmcloud.toml similarity index 100% rename from multi-channel-chat/http-channel/wasmcloud.toml rename to multi-channel-chat/httpchannel/wasmcloud.toml diff --git a/multi-channel-chat/multi-channel-chat.wadm.yaml b/multi-channel-chat/multi-channel-chat.wadm.yaml new file mode 100644 index 0000000..1a1aebe --- /dev/null +++ b/multi-channel-chat/multi-channel-chat.wadm.yaml @@ -0,0 +1 @@ +# WIP \ No newline at end of file diff --git a/multi-channel-chat/nats-channel/.cargo/config.toml b/multi-channel-chat/natschannel/.cargo/config.toml similarity index 100% rename from multi-channel-chat/nats-channel/.cargo/config.toml rename to multi-channel-chat/natschannel/.cargo/config.toml diff --git a/multi-channel-chat/nats-channel/.github/workflows/build.yml b/multi-channel-chat/natschannel/.github/workflows/build.yml similarity index 100% rename from multi-channel-chat/nats-channel/.github/workflows/build.yml rename to multi-channel-chat/natschannel/.github/workflows/build.yml diff --git a/multi-channel-chat/nats-channel/.github/workflows/release.yml b/multi-channel-chat/natschannel/.github/workflows/release.yml similarity index 100% rename from multi-channel-chat/nats-channel/.github/workflows/release.yml rename to multi-channel-chat/natschannel/.github/workflows/release.yml diff --git a/multi-channel-chat/nats-channel/.gitignore b/multi-channel-chat/natschannel/.gitignore similarity index 100% rename from multi-channel-chat/nats-channel/.gitignore rename to multi-channel-chat/natschannel/.gitignore diff --git a/multi-channel-chat/nats-channel/Cargo.lock b/multi-channel-chat/natschannel/Cargo.lock similarity index 100% rename from multi-channel-chat/nats-channel/Cargo.lock rename to multi-channel-chat/natschannel/Cargo.lock diff --git a/multi-channel-chat/nats-channel/Cargo.toml b/multi-channel-chat/natschannel/Cargo.toml similarity index 100% rename from multi-channel-chat/nats-channel/Cargo.toml rename to multi-channel-chat/natschannel/Cargo.toml diff --git a/multi-channel-chat/nats-channel/README.md b/multi-channel-chat/natschannel/README.md similarity index 100% rename from multi-channel-chat/nats-channel/README.md rename to multi-channel-chat/natschannel/README.md diff --git a/multi-channel-chat/nats-channel/build.rs b/multi-channel-chat/natschannel/build.rs similarity index 100% rename from multi-channel-chat/nats-channel/build.rs rename to multi-channel-chat/natschannel/build.rs diff --git a/multi-channel-chat/nats-channel/codegen.toml b/multi-channel-chat/natschannel/codegen.toml similarity index 100% rename from multi-channel-chat/nats-channel/codegen.toml rename to multi-channel-chat/natschannel/codegen.toml diff --git a/multi-channel-chat/nats-channel/src/chatlog.rs b/multi-channel-chat/natschannel/src/chatlog.rs similarity index 100% rename from multi-channel-chat/nats-channel/src/chatlog.rs rename to multi-channel-chat/natschannel/src/chatlog.rs diff --git a/multi-channel-chat/nats-channel/src/lib.rs b/multi-channel-chat/natschannel/src/lib.rs similarity index 100% rename from multi-channel-chat/nats-channel/src/lib.rs rename to multi-channel-chat/natschannel/src/lib.rs diff --git a/multi-channel-chat/nats-channel/src/outbound.rs b/multi-channel-chat/natschannel/src/outbound.rs similarity index 100% rename from multi-channel-chat/nats-channel/src/outbound.rs rename to multi-channel-chat/natschannel/src/outbound.rs diff --git a/multi-channel-chat/nats-channel/wasmcloud.toml b/multi-channel-chat/natschannel/wasmcloud.toml similarity index 100% rename from multi-channel-chat/nats-channel/wasmcloud.toml rename to multi-channel-chat/natschannel/wasmcloud.toml