Closed mszostok closed 2 years ago
Changes proposed in this pull request:
Requires https://github.com/capactio/capact/pull/620 to be merged before.
Build CLI: make build-tool-populator
make build-tool-populator
Pick some Implementation manifest and add change requires property:
requires
cap.core.type.platform: oneOf: - name: kubernetes revision: 0.1.0 - name: cap.type.platform.cloud-foundry revision: 0.1.0
Run Neo4j:
docker run -d \ -p 7687:7687 -p 7474:7474 \ -e "NEO4J_AUTH=neo4j/okon" \ -e "NEO4JLABS_PLUGINS=[\"apoc\"]" \ --name hub-neo4j-instance \ ghcr.io/capactio/neo4j:4.2.13-apoc
Populate database:
NOTE: ensure that you use newly built populator!
env APP_JSONPUBLISHADDR=http://$(ipconfig getifaddr en0) APP_JSON_PUBLISH_PORT="8888" APP_MANIFESTS_PATH="manifests" populator register ocf-manifests --source github.com/capactio/hub-manifests/
Run Public Hub:
cd hub-js; APP_NEO4J_ENDPOINT=bolt://localhost:7687 APP_NEO4J_PASSWORD=okon APP_HUB_MODE=public npm start
Run query to fetch your Implementation (e.g. use Insomnia):
In my case, I used "cap.implementation.mattermost.mattermost-team-edition.install":
"cap.implementation.mattermost.mattermost-team-edition.install"
query Impl { implementation( path: "cap.implementation.mattermost.mattermost-team-edition.install" ) { latestRevision { spec { requires { prefix oneOf { typeRef { path revision } alias } } } } } }
Output:
{ "data": { "implementation": { "latestRevision": { "spec": { "requires": [ { "prefix": "cap.core.type", "oneOf": [ { "typeRef": { "path": "cap.type.platform.cloud-foundry", "revision": "0.1.0" }, "alias": null }, { "typeRef": { "path": "cap.core.type.platform.kubernetes", "revision": "0.1.0" }, "alias": null } ] } ] } } } } }
Create cluster and populate it with https://github.com/mszostok/os-hub-manifests/tree/support-parent-nodes
https://github.com/mszostok/os-hub-manifests/tree/support-parent-nodes
Create TypeInstance:
cat > /tmp/helm-ti.yaml << ENDOFFILE typeInstances: - alias: helm-ti typeRef: path: cap.type.helm.storage revision: 0.1.0 value: url: "http://example.com/grpc" ENDOFFILE export TI_ID=$(capact ti create -f /tmp/helm-ti.yaml -ojson | jq -r '.[].id')
Create Action Policy:
cat <<EOF > /tmp/act-policy.yaml rules: - interface: path: cap.interface.capactio.capact.validation.hub.install oneOf: - implementationConstraints: path: "cap.implementation.capactio.capact.validation.io.install" inject: additionalParameters: - name: "mattermost-parameters" value: replicaCount: 3 - name: "rocketchat-parameters" value: replicaCount: 5 requiredTypeInstances: - id: ${TI_ID} description: "Helm storage" EOF
Create and run Action:
capact act create cap.interface.capactio.capact.validation.hub.install --name test --action-policy-from-file /tmp/act-policy.yaml
capact act run test capact act watch test argo logs test
You should that TypeInstance was injected and details are available in workflow:
cat /helm-storage.yaml url: http://example.com/grpc
Description
Changes proposed in this pull request:
Requires https://github.com/capactio/capact/pull/620 to be merged before.
Testing
Build CLI:
make build-tool-populator
Pick some Implementation manifest and add change
requires
property:Run Neo4j:
Populate database:
make build-tool-populator
NOTE: ensure that you use newly built populator!
Run Public Hub:
Run query to fetch your Implementation (e.g. use Insomnia):
In my case, I used
"cap.implementation.mattermost.mattermost-team-edition.install"
:Output:
Option 2
Create cluster and populate it with
https://github.com/mszostok/os-hub-manifests/tree/support-parent-nodes
Create TypeInstance:
Create Action Policy:
Create and run Action:
You should that TypeInstance was injected and details are available in workflow:
Related issue(s)