Skip to content

Commit

Permalink
Cloud Deployment: Fix MVD cloud deployment health check failure (#30)
Browse files Browse the repository at this point in the history
* Cloud Deployment: Fix MVD cloud deployment health check failure (#217)

* Update liveness check

* Update liveness check

* Upgrade curl

* Update

* upgrade curl

* Update

* update liveness probe

* Update deployment/curl-upgrade.sh

Co-authored-by: Izabela Kulakowska <ikulakowska@microsoft.com>

* Fix typo

Co-authored-by: Izabela Kulakowska <ikulakowska@microsoft.com>
Co-authored-by: Max Zeier <33636338+zeier@users.noreply.github.com>

* terraform fmt

Co-authored-by: Izabela Kulakowska <ikulakowska@microsoft.com>
Co-authored-by: Max Zeier <33636338+zeier@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 27, 2022
1 parent 30daa00 commit 9362f36
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 3 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,21 @@ jobs:
name: ${{ steps.runterraform.outputs.connector_name }}
vault: ${{ steps.runterraform.outputs.key_vault }}

# To support --retry-all-errors flag at least curl version 7.71.0 is required.
- name: 'Upgrade Curl'
run: sudo -E bash deployment/curl-upgrade.sh
working-directory: .
env:
VERSION: 7.84.0

- name: 'Verify GAIA-X Authority DID endpoint is available'
run: curl https://${{ steps.runterraform.outputs.gaiax_did_host }}/.well-known/did.json | jq '.id'

- name: 'Verify Dataspace DID endpoint is available'
run: curl https://${{ steps.runterraform.outputs.dataspace_did_host }}/.well-known/did.json | jq '.id'

- name: 'Verify deployed Registration Service is healthy'
run: curl --retry 6 --fail ${{ steps.runterraform.outputs.registration_service_url }}/api/check/health
run: curl --retry 10 --retry-all-errors --fail ${{ steps.runterraform.outputs.registration_service_url }}/api/check/health

# Deploy dataspace participants in parallel.
Deploy-Participants:
Expand Down Expand Up @@ -370,11 +377,18 @@ jobs:
- name: 'Upload inbox storage account key as vault secret'
run: az keyvault secret set --name "$INBOX_STORAGE_ACCOUNT-key1" --vault-name "$KEY_VAULT" --value "$INBOX_STORAGE_ACCOUNT_KEY" -o none

# To support --retry-all-errors flag at least curl version 7.71.0 is required.
- name: 'Upgrade Curl'
run: sudo -E bash deployment/curl-upgrade.sh
working-directory: .
env:
VERSION: 7.84.0

- name: 'Verify did endpoint is available'
run: curl https://$DID_HOST/.well-known/did.json | jq '.id'

- name: 'Verify deployed EDC is healthy'
run: curl --retry 6 --fail http://${EDC_HOST}:8181/api/check/health
run: curl --retry 10 --retry-all-errors --fail http://${EDC_HOST}:8181/api/check/health

- name: 'Seed data'
run: |
Expand Down
31 changes: 31 additions & 0 deletions deployment/curl-upgrade.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

set -euxo pipefail

# Check installed version of Ubuntu
Var=$(lsb_release -r)
NumOnly=$(cut -f2 <<< "$Var")

if [ "$NumOnly" != "20.04" ]; then
echo "This curl upgrade script is only verified on Ubuntu 20.04, please check if you are running this on the correct version of Ubuntu"
exit 1
fi

echo "Current installed version of cURL is: $(curl -V)"
echo "Removing old curl..."
apt remove -y curl && apt purge curl
echo "Updating apt cache..."
apt-get update
echo "Installing build-tools..."
apt-get install -y libssl-dev autoconf libtool make
echo "Download & extract curl version: $VERSION"
cd /usr/local/src
rm -rf curl*
wget -v https://curl.haxx.se/download/curl-$VERSION.zip && unzip curl-$VERSION.zip && cd curl-$VERSION
echo "Building & Configuring curl..."
./buildconf && ./configure --with-ssl && make && make install
echo "Moving curl to /usr/bin/curl and linking"
cp /usr/local/bin/curl /usr/bin/curl
ldconfig
echo "New upgraded version of curl is: $(curl -V)"
echo "curl upgraded successfully to version $VERSION!"
3 changes: 3 additions & 0 deletions deployment/terraform/dataspace/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ resource "azurerm_container_group" "registration-service" {
port = 8181
path = "/api/check/health"
}
initial_delay_seconds = 10
failure_threshold = 6
timeout_seconds = 3
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion deployment/terraform/participant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ resource "azurerm_container_group" "edc" {
port = 8181
path = "/api/check/health"
}
failure_threshold = 6
initial_delay_seconds = 10
failure_threshold = 6
timeout_seconds = 3
}
}
}
Expand Down

0 comments on commit 9362f36

Please sign in to comment.