Skip to content

Commit

Permalink
Adapt workflow 03 to this branch and change devops cu_manager module …
Browse files Browse the repository at this point in the history
…import reference
  • Loading branch information
javibu13 committed Dec 19, 2023
1 parent bc4461c commit 97a57d4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
48 changes: 24 additions & 24 deletions .github/workflows/03_deploy_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,40 @@ name: Deploy cycler to PRODUCTION
on:
push:
branches:
- 'datatypes'
- 'devops'

pull_request_review:
types:
- submitted

jobs:

publish-extra-pkg-prod:
# if: ${{ github.event_name == 'pull_request_review' &&
# github.event.review.state == 'approved' &&
# github.event.pull_request.head.ref == 'develop' &&
# github.event.pull_request.base.ref == 'master' }}
name: Build and publish cycler extra package
uses: ./.github/workflows/publish-extra-package.yml
with:
is-production: true
# publish-extra-pkg-prod:
# # if: ${{ github.event_name == 'pull_request_review' &&
# # github.event.review.state == 'approved' &&
# # github.event.pull_request.head.ref == 'develop' &&
# # github.event.pull_request.base.ref == 'master' }}
# name: Build and publish cycler extra package
# uses: ./.github/workflows/publish-extra-package.yml
# with:
# is-production: true

publish-cycler-pkg-prod:
# if: ${{ github.event_name == 'pull_request_review' &&
# github.event.review.state == 'approved' &&
# github.event.pull_request.head.ref == 'develop' &&
# github.event.pull_request.base.ref == 'master' }}
name: Build and publish cycler package
uses: ./.github/workflows/build_publish_package.yml
with:
package-name: "${{ vars.CYCLER_PACKAGE_NAME }}"
package-path: "code/cycler"
source-path: "code/cycler/src/${{ vars.CYCLER_PACKAGE_NAME }}"
is-production: true
# publish-cycler-pkg-prod:
# # if: ${{ github.event_name == 'pull_request_review' &&
# # github.event.review.state == 'approved' &&
# # github.event.pull_request.head.ref == 'develop' &&
# # github.event.pull_request.base.ref == 'master' }}
# name: Build and publish cycler package
# uses: ./.github/workflows/build_publish_package.yml
# with:
# package-name: "${{ vars.CYCLER_PACKAGE_NAME }}"
# package-path: "code/cycler"
# source-path: "code/cycler/src/${{ vars.CYCLER_PACKAGE_NAME }}"
# is-production: true

publish-docker-image-cycler:
name: Publish cycler docker image
needs: [ publish-cycler-pkg-prod, publish-extra-pkg-prod ]
# needs: [ publish-cycler-pkg-prod, publish-extra-pkg-prod ]
uses: WattRex/Battery-Experiments-Manager/.github/workflows/docker_image.yml@develop
secrets:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD_RALDEA }}
Expand All @@ -53,7 +53,7 @@ jobs:

publish-docker-image-db-sync:
name: Publish db-sync docker image
needs: [ publish-cycler-pkg-prod, publish-extra-pkg-prod ]
# needs: [ publish-cycler-pkg-prod, publish-extra-pkg-prod ]
uses: WattRex/Battery-Experiments-Manager/.github/workflows/docker_image.yml@develop
secrets:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD_RALDEA }}
Expand Down
2 changes: 1 addition & 1 deletion devops/cu_manager/run_cu_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
log: Logger = sys_log_logger_get_module_logger(__name__)

####################### MODULE IMPORTS #######################
from wattrex_battery_cycler_cu_manager import CuManagerNodeC
from wattrex_cycler_cu_manager import CuManagerNodeC

####################### PROJECT IMPORTS #######################

Expand Down
2 changes: 2 additions & 0 deletions devops/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ instance_new_cycler () {
check_sniffer "can"
check_sniffer "scpi"
export CYCLER_TARGET=cycler_prod

docker compose ${DOCKER_COMPOSE_ARGS} build --build-arg UPDATE_REQS=$(date +%s) cycler
docker compose ${DOCKER_COMPOSE_ARGS} run -d -e CSID=${1} --name wattrex_cycler_node_${1} cycler
}
Expand Down Expand Up @@ -139,6 +140,7 @@ case ${ARG1} in
# echo "Initial Deploy"
export CYCLER_TARGET=db_sync_prod
docker compose ${DOCKER_COMPOSE_ARGS} pull db_sync
docker compose ${DOCKER_COMPOSE_ARGS} pull cycler
initial_deploy
;;
"build")
Expand Down

0 comments on commit 97a57d4

Please sign in to comment.