diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 27fa0ff2..a093f150 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -12,8 +12,6 @@ jobs: matrix: dockerfile: - orchestrator-server - - orchestrator-chaincode - - orchestrator-chaincode-init steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 2188999e..434a3968 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -8,7 +8,7 @@ on: pull_request: branches: [main] -concurrency: +concurrency: group: "${{ github.workflow_ref }} - ${{ github.ref }} - ${{ github.event_name }}" cancel-in-progress: true @@ -16,7 +16,7 @@ jobs: build: strategy: matrix: - images: [orchestrator-server, orchestrator-chaincode, orchestrator-chaincode-init] + images: [orchestrator-server] uses: substra/substra-gha-workflows/.github/workflows/docker-build.yaml@main with: - image: ${{ matrix.images }} \ No newline at end of file + image: ${{ matrix.images }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c61729e..fbfe6fc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Removed + +- BREAKING: `distributed` Skaffold profile and mentions in doc ([#319](https://github.com/Substra/orchestrator/pull/319)) +- BREAKING: `chaincode-init` and `chaincode` Dockerfiles ([#319](https://github.com/Substra/orchestrator/pull/319)) + ## [0.37.0](https://github.com/Substra/orchestrator/releases/tag/0.37.0) - 2023-10-18 ### Added diff --git a/Makefile b/Makefile index 78a48df6..704336f7 100644 --- a/Makefile +++ b/Makefile @@ -16,10 +16,7 @@ pbgo = $(protobufs:.proto=.pb.go) build_env = CGO_ENABLED=0 .PHONY: all -all: chaincode orchestrator ## Build all binaries - -.PHONY: chaincode -chaincode: $(CHAINCODE_BIN) ## Build chaincode binary +all: orchestrator ## Build all binaries .PHONY: orchestrator orchestrator: $(ORCHESTRATOR_BIN) ## Build server binary diff --git a/README.md b/README.md index 19f23e60..d8fde39a 100644 --- a/README.md +++ b/README.md @@ -108,43 +108,6 @@ grpcurl -insecure orchestrator.org-1.com:443 list You can also deploy [substra-backend](https://github.com/substra/substra-backend) with a `skaffold dev` or `skaffold run` -### Distributed mode - -In distributed mode, the orchestrator only requires a matching chaincode. -So you need to build the chaincode image (from this repo) to be used in `hlf-k8s` in your k8s cluster. -Choose a tag (example uses `dev`). - -```bash -# If you use minikube, run `eval $(minikube -p minikube docker-env)` before the `docker build` command -# If you use kind, run `kind load docker-image ghcr.io/substra/orchestrator-chaincode:dev` after the `docker build` command -# If you use k3d, run `k3d image import ghcr.io/substra/orchestrator-chaincode:dev` -docker build -f docker/orchestrator-chaincode/Dockerfile -t ghcr.io/substra/orchestrator-chaincode:dev . -docker build -f docker/orchestrator-chaincode-init/Dockerfile -t ghcr.io/substra/orchestrator-chaincode-init:dev . -``` - -Update hlf-k8s' values so that it uses your `dev` image instead of `latest`. - -Deploy [hlf-k8s](https://github.com/substra/hlf-k8s) with a `skaffold dev` or `skaffold run`. - -Then, in the orchestrator repo: - -```bash -skaffold dev -p distributed -``` - -or -```bash -skaffold run -p distributed -``` - -Assuming `orchestrator.org-1.com` and `orchestrator.org-2.com` are pointing to your local k8s cluster IP (edit your `/etc/hosts` file for that), the following command should list available services: - -```bash -grpcurl --cacert examples/tools/ca.crt --key examples/tools/client-org-1.key --cert examples/tools/client-org-1.crt --rpc-header 'mspid: MyOrg1MSP' --rpc-header 'channel: mychannel' --rpc-header 'chaincode: mycc' orchestrator.org-1.com:443 list -``` - -You can also deploy [substra-backend](https://github.com/substra/substra-backend) with a `skaffold dev -p distributed` or `skaffold run -p distributed` - ### Testing You can call the local orchestrator gRPC endpoint using [evans](https://github.com/ktr0731/evans) diff --git a/docker/orchestrator-chaincode-init/Dockerfile b/docker/orchestrator-chaincode-init/Dockerfile deleted file mode 100644 index 94f793ea..00000000 --- a/docker/orchestrator-chaincode-init/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM alpine:3.18 - -SHELL ["/bin/ash", "-eo", "pipefail", "-c"] - -COPY ./docker/orchestrator-chaincode-init/dependencies.json /tmp/dependencies.json - -# hadolint ignore=DL3018 -RUN apk update && apk add --no-cache jq \ - && jq -r '.[] | "\(.name)=\(.version)"' /tmp/dependencies.json | xargs apk add --no-cache \ - && rm /tmp/dependencies.json - -COPY ./scripts/create-indexes.sh /usr/bin/create-indexes - -CMD ["/usr/bin/create-indexes"] diff --git a/docker/orchestrator-chaincode-init/dependencies.json b/docker/orchestrator-chaincode-init/dependencies.json deleted file mode 100644 index 6c6b58d5..00000000 --- a/docker/orchestrator-chaincode-init/dependencies.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "name": "curl", - "version": "8.4.0-r0" - }, - { - "name": "bash", - "version": "5.2.15-r5" - } -] \ No newline at end of file diff --git a/docker/orchestrator-chaincode/Dockerfile b/docker/orchestrator-chaincode/Dockerfile deleted file mode 100644 index 78959e0c..00000000 --- a/docker/orchestrator-chaincode/Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -# Build stage -FROM golang:1.21-alpine3.18 AS build -COPY ./docker/orchestrator-chaincode/dependencies.json /tmp/dependencies.json - -SHELL ["/bin/ash", "-eo", "pipefail", "-c"] - -# hadolint ignore=DL3018 -RUN apk update && apk add --no-cache jq \ - && jq -r '.[] | "\(.name)=\(.version)"' /tmp/dependencies.json | xargs apk add --no-cache \ - && rm /tmp/dependencies.json - -ARG VERSION=dev -ENV GO111MODULE=on -ENV SRC_DIR=/usr/src/chaincode - -# Install protobuf codegen dependencies -RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 && \ - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0 - -WORKDIR ${SRC_DIR} - -# Cache dependencies -COPY ./go.mod ./go.sum ${SRC_DIR}/ -RUN go mod download - -COPY . ${SRC_DIR} - -RUN make ./bin/chaincode VERSION=$VERSION && mv ./bin/chaincode /bin/chaincode - - -# Expose the binary -FROM alpine:3.18 as prod - -COPY --from=build /bin/chaincode /app/chaincode -USER 1000 -WORKDIR /app - -CMD ["/app/chaincode"] diff --git a/docker/orchestrator-chaincode/dependencies.json b/docker/orchestrator-chaincode/dependencies.json deleted file mode 100644 index 818fac8d..00000000 --- a/docker/orchestrator-chaincode/dependencies.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "name": "git", - "version": "2.40.1-r0" - }, - { - "name": "make", - "version": "4.4.1-r1" - }, - { - "name": "protoc", - "version": "3.21.12-r2" - }, - { - "name": "protobuf-dev", - "version": "3.21.12-r2" - } -] \ No newline at end of file diff --git a/skaffold.yaml b/skaffold.yaml index 6f7e290c..fe8ba3fb 100644 --- a/skaffold.yaml +++ b/skaffold.yaml @@ -25,26 +25,6 @@ manifests: deploy: helm: {} profiles: - - name: distributed - patches: - - op: replace - path: /manifests/helm/releases/0/valuesFiles - value: - - examples/values/orchestrator-org-1-distributed.yaml - - op: add - path: /manifests/helm/releases/- - value: - setValueTemplates: - orchestrator.image.registry: "{{.IMAGE_DOMAIN_substra_orchestrator_server}}" - orchestrator.image.repository: "{{.IMAGE_REPO_NO_DOMAIN_substra_orchestrator_server}}" - orchestrator.image.tag: "{{.IMAGE_TAG_substra_orchestrator_server}}@{{.IMAGE_DIGEST_substra_orchestrator_server}}" - chartPath: charts/orchestrator - createNamespace: true - name: orchestrator-org-2 - namespace: org-2 - skipBuildDependencies: true - valuesFiles: - - examples/values/orchestrator-org-2-distributed.yaml - name: nodeps patches: - op: add