From e40d007740428ddb40a59ee6d207c1a3993614ad Mon Sep 17 00:00:00 2001 From: Alex Wellnitz Date: Tue, 19 Dec 2023 12:41:47 +0100 Subject: [PATCH 1/9] Update API health check commands and add JSON parsing with jq --- docs/tutorials/e2e/connect/deployComponents.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/tutorials/e2e/connect/deployComponents.md b/docs/tutorials/e2e/connect/deployComponents.md index cb400704f777..84b285603e33 100644 --- a/docs/tutorials/e2e/connect/deployComponents.md +++ b/docs/tutorials/e2e/connect/deployComponents.md @@ -148,8 +148,10 @@ assets, policies and contract definitions. In order to check that the connectors were deployed successfully, please execute the following commands in a shell: ```shell -curl -X GET http://localhost/bob/health/api/check/liveness -curl -X GET http://localhost/alice/health/api/check/liveness +curl -X GET http://localhost/bob/health/api/check/liveness | jq +``` +```shell +curl -X GET http://localhost/alice/health/api/check/liveness | jq ``` which should return something similar to this, the important part being the `isSystemHealthy: true` bit: @@ -175,7 +177,7 @@ which should return something similar to this, the important part being the `isS Once we've established the basic readiness of our connectors, we can move on to inspect a few data items: ```shell -curl -X POST http://localhost/bob/management/v3/assets/request -H "x-api-key: password" -H "content-type: application/json" +curl -X POST http://localhost/bob/management/v3/assets/request -H "x-api-key: password" -H "content-type: application/json" | jq ``` This queries the `/assets` endpoint returning the entire list of assets that `bob` currently maintains. You should see @@ -236,9 +238,12 @@ Note: the same thing can be done to inspect policies and contract definitions. T ```shell # policies: -curl -X POST http://localhost/bob/management/v2/policydefinitions/request -H "x-api-key: password" -H "content-type: application/json" +curl -X POST http://localhost/bob/management/v2/policydefinitions/request -H "x-api-key: password" -H "content-type: application/json" | jq +``` + +```shell # contract defs: -curl -X POST http://localhost/bob/management/v2/contractdefinitions/request -H "x-api-key: password" -H "content-type: application/json" +curl -X POST http://localhost/bob/management/v2/contractdefinitions/request -H "x-api-key: password" -H "content-type: application/json" | jq ``` Alternatively, please check out the [Postman collections here](./postman) From f75e028ff85ad16f64f13beaf3611f29c917795d Mon Sep 17 00:00:00 2001 From: Alex Wellnitz Date: Tue, 19 Dec 2023 12:55:19 +0100 Subject: [PATCH 2/9] Update deployment instructions for connecting components --- .../tutorials/e2e/connect/deployComponents.md | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/docs/tutorials/e2e/connect/deployComponents.md b/docs/tutorials/e2e/connect/deployComponents.md index 84b285603e33..90184276ee00 100644 --- a/docs/tutorials/e2e/connect/deployComponents.md +++ b/docs/tutorials/e2e/connect/deployComponents.md @@ -39,21 +39,38 @@ For the most bare-bones installation of the dataspace, execute the following com ```shell # get the tutorial including the config file for the cluster by cloning the repository locally git clone https://github.com/eclipse-tractusx/tutorial-resources.git +``` +```shell # will install the mxd directory under /tutorial-resources/mxd # the directory should contain the config file for kind: kind.config.yaml cd +``` + +```shell kind create cluster -n mxd --config kind.config.yaml +``` + +```shell # # Now we activate ingress for the later port forwarding ? # the next step is specific to KinD and will be different for other Kubernetes runtimes! kubectl apply -f \ https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml +``` + +```shell # wait until the ingress controller is ready kubectl wait --namespace ingress-nginx \ --for=condition=ready pod \ --selector=app.kubernetes.io/component=controller \ --timeout=90s +``` + +```shell terraform init +``` + +```shell terraform apply # type "yes" and press enter when prompted to do so ``` @@ -114,6 +131,9 @@ of simplicity we will use a plain Kubernetes port-forwarding: ```shell # find out about the names of your pods kubectl get pods +``` + +```shell # you should see a list like: NAME READY STATUS RESTARTS AGE alice-tractusx-connector-controlplane-6f7555bcb7-mhxh6 1/1 Running 0 4m @@ -125,10 +145,13 @@ bob-vault-0 1/1 Running 0 keycloak-6bdf4d7689-8mwfd 1/1 Running 0 4m58s miw-574bf87bc-c4n6c 1/1 Running 0 4m58s postgres-66677b8665-lxxp2 1/1 Running 0 5m14s +``` + +```shell # # We will use the last entry for ingress for our port-forwarding, the name of the postgres pod will be slightly differnt in your local cluster. # now we activtae the kuberntes port-forwarding: -kubectl port-forward postgres-66677b8665-lxxp2 5432:5423 +kubectl port-forward postgres-66677b8665-lxxp2 5432:5432 ``` > Note that the actual pod name will be slightly different in your local cluster. From f5d27d343c4178d2c675e6c483799309d95aee95 Mon Sep 17 00:00:00 2001 From: Alex Wellnitz Date: Tue, 19 Dec 2023 13:24:07 +0100 Subject: [PATCH 3/9] Update API endpoints and add data parsing with jq --- docs/tutorials/e2e/boost/provideData.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/tutorials/e2e/boost/provideData.md b/docs/tutorials/e2e/boost/provideData.md index fed6136c2d2a..7a8a7bf1a308 100644 --- a/docs/tutorials/e2e/boost/provideData.md +++ b/docs/tutorials/e2e/boost/provideData.md @@ -30,7 +30,7 @@ curl --location 'http://localhost/bob/management/v2/assets' \ "type": "HttpData", "baseUrl": "https://jsonplaceholder.typicode.com/todos/3" } -}' +}' | jq ``` ## Request catalog @@ -51,7 +51,7 @@ curl --location 'http://localhost/alice/management/v2/catalog/request' \ "offset": 0, "limit": 100 } -}' +}' | jq ``` ## Create first access policy @@ -73,11 +73,11 @@ curl --location 'http://localhost/bob/management/v2/policydefinitions' \ "odrl": "http://www.w3.org/ns/odrl/2/" }, "@type": "PolicyDefinitionRequestDto", - "@id": "31", + "@id": "3-1", "policy": { "@type": "Policy" } -}' +}' | jq ``` ## Request catalog - second try @@ -98,7 +98,7 @@ curl --location 'http://localhost/alice/management/v2/catalog/request' \ "offset": 0, "limit": 100 } -}' +}' | jq ``` ## Create first contract definition @@ -133,11 +133,11 @@ curl --location 'http://localhost/bob/management/v2/policydefinitions' \ "odrl": "http://www.w3.org/ns/odrl/2/" }, "@type": "PolicyDefinitionRequestDto", - "@id": "32", + "@id": "3-2", "policy": { "@type": "Policy" } -}' +}' | jq ``` Action (Bob): Create a contract definition including the asset and the policies you have created. For this, use the following `curl` command: @@ -150,15 +150,15 @@ curl --location 'http://localhost/bob/management/v2/contractdefinitions' \ "@context": {}, "@id": "3", "@type": "ContractDefinition", - "accessPolicyId": "31", - "contractPolicyId": "32", + "accessPolicyId": "3-1", + "contractPolicyId": "3-2", "assetsSelector": { "@type": "CriterionDto", "operandLeft": "https://w3id.org/edc/v0.0.1/ns/id", "operator": "=", "operandRight": "3" } -}' +}' | jq ``` ## Request catalog - third try @@ -178,7 +178,7 @@ curl --location 'http://localhost/alice/management/v2/catalog/request' \ "offset": 0, "limit": 100 } -}' +}' | jq ``` :::info From 8d1cabcc5cda95f96a19b88275c20dff816c49da Mon Sep 17 00:00:00 2001 From: Alex Wellnitz <141134451+awellnitz-materna@users.noreply.github.com> Date: Tue, 23 Jan 2024 08:02:14 +0100 Subject: [PATCH 4/9] Update docs/tutorials/e2e/connect/deployComponents.md Co-authored-by: Florian Rusch (ZF Friedrichshafen AG) --- docs/tutorials/e2e/connect/deployComponents.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/tutorials/e2e/connect/deployComponents.md b/docs/tutorials/e2e/connect/deployComponents.md index 90184276ee00..4bcd6ea5fd00 100644 --- a/docs/tutorials/e2e/connect/deployComponents.md +++ b/docs/tutorials/e2e/connect/deployComponents.md @@ -44,7 +44,6 @@ git clone https://github.com/eclipse-tractusx/tutorial-resources.git # will install the mxd directory under /tutorial-resources/mxd # the directory should contain the config file for kind: kind.config.yaml cd -``` ```shell kind create cluster -n mxd --config kind.config.yaml From 4efeea2aa83a1f2ffed49c22e7061b8c6d6f3ed8 Mon Sep 17 00:00:00 2001 From: Alex Wellnitz <141134451+awellnitz-materna@users.noreply.github.com> Date: Tue, 23 Jan 2024 08:02:24 +0100 Subject: [PATCH 5/9] Update docs/tutorials/e2e/connect/deployComponents.md Co-authored-by: Florian Rusch (ZF Friedrichshafen AG) --- docs/tutorials/e2e/connect/deployComponents.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/tutorials/e2e/connect/deployComponents.md b/docs/tutorials/e2e/connect/deployComponents.md index 4bcd6ea5fd00..4bac247383b1 100644 --- a/docs/tutorials/e2e/connect/deployComponents.md +++ b/docs/tutorials/e2e/connect/deployComponents.md @@ -47,7 +47,6 @@ cd ```shell kind create cluster -n mxd --config kind.config.yaml -``` ```shell # From ee15884dcd9aa3ddcfc4bb84888c6ed7816fde3a Mon Sep 17 00:00:00 2001 From: Alex Wellnitz <141134451+awellnitz-materna@users.noreply.github.com> Date: Tue, 23 Jan 2024 08:05:15 +0100 Subject: [PATCH 6/9] Update docs/tutorials/e2e/connect/deployComponents.md Co-authored-by: Florian Rusch (ZF Friedrichshafen AG) --- docs/tutorials/e2e/connect/deployComponents.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/tutorials/e2e/connect/deployComponents.md b/docs/tutorials/e2e/connect/deployComponents.md index 4bac247383b1..c96e08733e56 100644 --- a/docs/tutorials/e2e/connect/deployComponents.md +++ b/docs/tutorials/e2e/connect/deployComponents.md @@ -47,6 +47,7 @@ cd ```shell kind create cluster -n mxd --config kind.config.yaml +``` ```shell # From be92d1987cf1422aa9087de22b51da00cd4f163a Mon Sep 17 00:00:00 2001 From: Alex Wellnitz <141134451+awellnitz-materna@users.noreply.github.com> Date: Tue, 23 Jan 2024 08:05:34 +0100 Subject: [PATCH 7/9] Update docs/tutorials/e2e/connect/deployComponents.md Co-authored-by: Florian Rusch (ZF Friedrichshafen AG) --- docs/tutorials/e2e/connect/deployComponents.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/tutorials/e2e/connect/deployComponents.md b/docs/tutorials/e2e/connect/deployComponents.md index c96e08733e56..ead395103ef9 100644 --- a/docs/tutorials/e2e/connect/deployComponents.md +++ b/docs/tutorials/e2e/connect/deployComponents.md @@ -44,6 +44,7 @@ git clone https://github.com/eclipse-tractusx/tutorial-resources.git # will install the mxd directory under /tutorial-resources/mxd # the directory should contain the config file for kind: kind.config.yaml cd +``` ```shell kind create cluster -n mxd --config kind.config.yaml From f4e9ee1a596ca1c92b76bf318c0237fe113f0712 Mon Sep 17 00:00:00 2001 From: Alex Wellnitz <141134451+awellnitz-materna@users.noreply.github.com> Date: Tue, 23 Jan 2024 08:09:37 +0100 Subject: [PATCH 8/9] Update docs/tutorials/e2e/connect/deployComponents.md Co-authored-by: Florian Rusch (ZF Friedrichshafen AG) --- docs/tutorials/e2e/connect/deployComponents.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/tutorials/e2e/connect/deployComponents.md b/docs/tutorials/e2e/connect/deployComponents.md index ead395103ef9..b0b164c76773 100644 --- a/docs/tutorials/e2e/connect/deployComponents.md +++ b/docs/tutorials/e2e/connect/deployComponents.md @@ -40,6 +40,7 @@ For the most bare-bones installation of the dataspace, execute the following com # get the tutorial including the config file for the cluster by cloning the repository locally git clone https://github.com/eclipse-tractusx/tutorial-resources.git ``` + ```shell # will install the mxd directory under /tutorial-resources/mxd # the directory should contain the config file for kind: kind.config.yaml From 34af7638be24181866f71a907bf8cd485bef227b Mon Sep 17 00:00:00 2001 From: Alex Wellnitz <141134451+awellnitz-materna@users.noreply.github.com> Date: Tue, 23 Jan 2024 08:09:47 +0100 Subject: [PATCH 9/9] Update docs/tutorials/e2e/connect/deployComponents.md Co-authored-by: Florian Rusch (ZF Friedrichshafen AG) --- docs/tutorials/e2e/connect/deployComponents.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/tutorials/e2e/connect/deployComponents.md b/docs/tutorials/e2e/connect/deployComponents.md index b0b164c76773..9eda1ad00f5e 100644 --- a/docs/tutorials/e2e/connect/deployComponents.md +++ b/docs/tutorials/e2e/connect/deployComponents.md @@ -174,6 +174,7 @@ In order to check that the connectors were deployed successfully, please execute ```shell curl -X GET http://localhost/bob/health/api/check/liveness | jq ``` + ```shell curl -X GET http://localhost/alice/health/api/check/liveness | jq ```