Skip to content

Commit

Permalink
deploy/docker: CLI auth support
Browse files Browse the repository at this point in the history
Upgrade the CLI tools in the docker deployment to the latest versions
that have auth support. This fixes end-to-end script which did not work
since the deployment had auth enabled.

Signed-off-by: Sergei Trofimov <[email protected]>
  • Loading branch information
setrofim committed Sep 18, 2023
1 parent b93231b commit c6824b6
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 3 deletions.
2 changes: 2 additions & 0 deletions deployments/docker/src/builder-dispatcher
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ function deploy() {
set +a
cat $BUILD_DIR/deployments/docker/src/config.yaml.template | envsubst > $DEPLOY_DIR/config.yaml
cat $BUILD_DIR/deployments/docker/src/keycloak.conf.template | envsubst > $DEPLOY_DIR/keycloak.conf
cat $BUILD_DIR/deployments/docker/src/cocli-config.yaml.template | envsubst > $DEPLOY_DIR/utils/cocli-config.yaml
cat $BUILD_DIR/deployments/docker/src/pocli-config.yaml.template | envsubst > $DEPLOY_DIR/utils/pocli-config.yaml

echo "initializing stores"
for t in en ta po
Expand Down
2 changes: 1 addition & 1 deletion deployments/docker/src/builder.docker
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ RUN go mod download &&\
go install google.golang.org/protobuf/cmd/[email protected] &&\
go install google.golang.org/grpc/cmd/[email protected] &&\
go install github.com/mitchellh/[email protected] &&\
go install github.com/veraison/corim/cocli@latest &&\
go install github.com/veraison/corim/cocli@eeb7bd48 &&\
go install github.com/veraison/evcli/v2@latest &&\
go install github.com/veraison/pocli@latest &&\
go install github.com/go-delve/delve/cmd/dlv@latest
Expand Down
8 changes: 8 additions & 0 deletions deployments/docker/src/cocli-config.yaml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
api_server: http://provisioning-service:${PROVISIONING_PORT}/endorsement-provisioning/v1/submit
auth: oauth2
username: veraison-provisioner
password: veraison
client_id: veraison-client
client_secret: YifmabB4cVSPPtFLAmHfq7wKaEHQn10Z
token_url: http://keycloak-service:${KEYCLOAK_PORT}/realms/veraison/protocol/openid-connect/token
# vim: set ft=yaml:
2 changes: 1 addition & 1 deletion deployments/docker/src/config.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ po-agent:
auth:
backend: keycloak
host: keycloak-service
port: 11111
port: ${KEYCLOAK_PORT}
# vim: set ft=yaml:
4 changes: 3 additions & 1 deletion deployments/docker/src/manager.docker
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ USER manager
WORKDIR /opt/veraison

RUN mkdir -p /home/manager/.config/pocli && \
echo "host: management-service" > /home/manager/.config/pocli/config.yaml
mkdir -p /home/manager/.config/cocli

ADD --chown=manager:nogroup utils/evcli utils/cocli utils/pocli ./utils/
ADD --chown=manager:nogroup manager-dispatcher ./
ADD --chown=manager:nogroup utils/cocli-config.yaml /home/manager/.config/cocli/config.yaml
ADD --chown=manager:nogroup utils/pocli-config.yaml /home/manager/.config/pocli/config.yaml

ENTRYPOINT ["/opt/veraison/manager-dispatcher"]
CMD ["help"]
Expand Down
9 changes: 9 additions & 0 deletions deployments/docker/src/pocli-config.yaml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
host: management-service
port: ${MANAGEMENT_PORT}
auth: oauth2
username: veraison-provisioner
password: veraison
client_id: veraison-client
client_secret: YifmabB4cVSPPtFLAmHfq7wKaEHQn10Z
token_url: http://keycloak-service:${KEYCLOAK_PORT}/realms/veraison/protocol/openid-connect/token
# vim: set ft=yaml:

0 comments on commit c6824b6

Please sign in to comment.