From a735bd1d60aaf278d6fb494e1f7cb5b0f45c39de Mon Sep 17 00:00:00 2001 From: alexcos20 Date: Wed, 24 Jan 2024 15:57:47 +0200 Subject: [PATCH] add c2d --- cleanup.sh | 8 +++++++- compose-files/c2d.yml | 42 ++++++++++++++++++++++++++++++++++++++ compose-files/registry.yml | 21 +++++++++++++++++++ start_ocean.sh | 16 +++++++++++++++ 4 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 compose-files/c2d.yml create mode 100644 compose-files/registry.yml diff --git a/cleanup.sh b/cleanup.sh index a6718dc..d6bf71d 100755 --- a/cleanup.sh +++ b/cleanup.sh @@ -4,13 +4,19 @@ docker container stop ocean_ocean-contracts_1 docker container stop ocean_typesense_1 docker container stop ocean_ganache_1 docker container stop ocean_dashboard_1 +docker container stop ocean_computetodata_1 +docker container stop ocean_kindcluster_1 +docker container stop docker-registry docker container rm ocean_ipfs_1 docker container rm ocean_ocean-contracts_1 docker container rm ocean_typesense_1 docker container rm ocean_ganache_1 docker container rm ocean_dashboard_1 - +docker container rm ocean_computetodata_1 +docker container rm ocean_kindcluster_1 +docker container rm docker-registry docker volume rm ocean_typesense1 +docker volume rm graphipfs docker network rm kind docker volume rm $(docker volume ls -q) diff --git a/compose-files/c2d.yml b/compose-files/c2d.yml new file mode 100644 index 0000000..621775d --- /dev/null +++ b/compose-files/c2d.yml @@ -0,0 +1,42 @@ +version: '3' +services: + kindcluster: + image: oceanprotocol/c2d_barge_kind:v0.0.1 + privileged: true + ports: + - 8443:8443 + - 10080:10080 + - 31000:31000 + networks: + backend: + ipv4_address: 172.15.0.13 + environment: + STATIC_IP: 172.15.0.13 + REGISTRY: "172.15.0.11:5050" + REGISTRY_USER: "username" + REGISTRY_PASSWORD: '$REGISTRY_TOKEN' + volumes: + - ${OCEAN_CERTS_FOLDER}/registry:/certs + computetodata: + image: oceanprotocol/c2d_barge_deployer:latest + privileged: true + environment: + KIND_IP: 172.15.0.13 + IPFS_GATEWAY: ${IPFS_GATEWAY} + IPFS_HTTP_GATEWAY: ${IPFS_HTTP_GATEWAY} + REGISTRY: "172.15.0.11:5000/" + OPERATOR_SERVICE_IMAGE: ${OPERATOR_SERVICE_VERSION} + OPERATOR_ENGINE_IMAGE: ${OPERATOR_ENGINE_VERSION} + POD_CONFIGURATION_IMAGE: ${POD_CONFIGURATION_VERSION} + POD_PUBLISHING_IMAGE: ${POD_PUBLISHING_VERSION} + WAIT_FOR_C2DIMAGES: ${WAIT_FOR_C2DIMAGES} + networks: + backend: + ipv4_address: 172.15.0.12 + depends_on: + - kindcluster + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - /usr/bin/docker:/usr/bin/docker + - ${OCEAN_C2D_FOLDER}:/ocean/c2d/ + - ${OCEAN_CERTS_FOLDER}/registry:/certs \ No newline at end of file diff --git a/compose-files/registry.yml b/compose-files/registry.yml new file mode 100644 index 0000000..28ae839 --- /dev/null +++ b/compose-files/registry.yml @@ -0,0 +1,21 @@ +version: '3' +services: + registry: + restart: always + container_name: docker-registry + image: registry:2 + ports: + - 5050:5000 + networks: + backend: + ipv4_address: 172.15.0.11 + environment: + REGISTRY_HTTP_ADDR: "172.15.0.11:5000" + REGISTRY_HTTP_TLS_CERTIFICATE: /certs/registry.crt + REGISTRY_HTTP_TLS_KEY: /certs/registry.key + volumes: + - registryvol:/var/lib/registry + - ${OCEAN_CERTS_FOLDER}/registry:/certs + +volumes: + registryvol: \ No newline at end of file diff --git a/start_ocean.sh b/start_ocean.sh index 55ea832..784e324 100755 --- a/start_ocean.sh +++ b/start_ocean.sh @@ -31,6 +31,12 @@ COMPOSE_DIR="${DIR}/compose-files" export CONTRACTS_VERSION=${CONTRACTS_VERSION:-v2.0.3} export TYPESENSE_VERSION=${TYPESENSE_VERSION:-0.25.1} +export OPERATOR_SERVICE_VERSION=${OPERATOR_SERVICE_VERSION:-oceanprotocol/operator-service:v4main} +export OPERATOR_ENGINE_VERSION=${OPERATOR_ENGINE_VERSION:-oceanprotocol/operator-engine:v4main} +export POD_CONFIGURATION_VERSION=${POD_CONFIGURATION_VERSION:-oceanprotocol/pod-configuration:v4main} +export POD_PUBLISHING_VERSION=${POD_PUBLISHING_VERSION:-oceanprotocol/pod-publishing:v4main} +export WAIT_FOR_C2DIMAGES=${WAIT_FOR_C2DIMAGES:-false} + export PROJECT_NAME="ocean" export FORCEPULL="false" @@ -157,6 +163,16 @@ while :; do export DEPLOY_CONTRACTS=false printf $COLOR_Y'Ocean contracts will not be deployed, the last deployment (if any) will be intact ...\n\n'$COLOR_RESET ;; + --with-registry) + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/registry.yml" + printf $COLOR_Y'Starting with Registry...\n\n'$COLOR_RESET + ;; + --with-c2d) + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/registry.yml" + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/ipfs.yml" + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/c2d.yml" + printf $COLOR_Y'Starting with C2D...\n\n'$COLOR_RESET + ;; ################################################# # Cleaning switches #################################################