Skip to content

Commit

Permalink
Merge pull request #21 from cosmonic/update-pipeline-for-multi-channe…
Browse files Browse the repository at this point in the history
…l-chat

feat(mcc): update pipeline
  • Loading branch information
lachieh authored Oct 23, 2023
2 parents e37b8d6 + 1d22cba commit 206cebc
Show file tree
Hide file tree
Showing 43 changed files with 33 additions and 45 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-multichannelchat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
64 changes: 26 additions & 38 deletions .github/workflows/release-multichannelchat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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 }}
6 changes: 3 additions & 3 deletions multi-channel-chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion multi-channel-chat/multi-channel-chat.wadm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ spec:
traits:
- type: spreadscaler
properties:
replicas: 1
replicas: 1
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 206cebc

Please sign in to comment.