Skip to content

Commit

Permalink
aws-eks-namespace-test
Browse files Browse the repository at this point in the history
t


c


t


c


t


c


t


c


t


c


t


c


t


c


t


c


t


c


t
  • Loading branch information
ArjaanBuijk committed Mar 24, 2021
1 parent cbcaea4 commit 27297ad
Showing 1 changed file with 82 additions and 90 deletions.
172 changes: 82 additions & 90 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ env:
AWS_ECR_URI: 024629701212.dkr.ecr.us-west-2.amazonaws.com
AWS_ECR_REPOSITORY: financial-demo
AWS_S3_NAME: rasa-financial-demo
AWS_EKS_CREATE: 'false'
AWS_EKS_DELETE_NAMESPACE_TEST: 'true'

jobs:
params:
Expand All @@ -36,8 +38,9 @@ jobs:

aws_region: ${{ steps.aws.outputs.aws_region }}
aws_s3: ${{ steps.aws.outputs.aws_s3 }}
aws_stack_name: ${{ steps.aws.outputs.aws_stack_name }}
aws_stack_type: ${{ steps.aws.outputs.aws_stack_type }}
aws_eks_create: ${{ steps.aws.outputs.aws_eks_create }}
aws_eks_namespace_test: ${{ steps.aws.outputs.aws_eks_namespace_test }}
aws_eks_namespace_prod: ${{ steps.aws.outputs.aws_eks_namespace_prod }}

steps:
- name: checkout
Expand Down Expand Up @@ -109,8 +112,9 @@ jobs:
run: |
echo "::set-output name=aws_region::${{ env.AWS_REGION }}"
echo "::set-output name=aws_s3::financial-demo"
echo "::set-output name=aws_stack_name::financial-demo-${GITHUB_ACTOR}-${GITHUB_REF##*/}"
echo "::set-output name=aws_stack_type::test"
echo "::set-output name=aws_eks_create::${{ env.AWS_EKS_CREATE }}"
echo "::set-output name=aws_eks_namespace_test::${GITHUB_ACTOR}-${GITHUB_REF##*/}"
echo "::set-output name=aws_eks_namespace_prod::prod"
params_summary:
name: params_summary
Expand All @@ -129,8 +133,9 @@ jobs:
echo do_training: ${{ needs.params.outputs.do_training }}
echo aws_region: ${{ needs.params.outputs.aws_region }}
echo aws_s3: ${{ needs.params.outputs.aws_s3 }}
echo aws_stack_name: ${{ needs.params.outputs.aws_stack_name }}
echo aws_stack_type: ${{ needs.params.outputs.aws_stack_type }}
echo aws_eks_create: ${{ needs.params.outputs.aws_eks_create }}
echo aws_eks_namespace_test: ${{ needs.params.outputs.aws_eks_namespace_test }}
echo aws_eks_namespace_prod: ${{ needs.params.outputs.aws_eks_namespace_prod }}
#
# - name: Dump GitHub context
# env:
Expand Down Expand Up @@ -212,19 +217,19 @@ jobs:
make docker-push \
ACTION_SERVER_DOCKERPATH=${{ steps.action_server.outputs.docker_image_full_name }}
# - name: Push docker image to docker.io/rasa, when on main
# if: |
# github.ref == 'refs/heads/main' || github.head_ref == 'refs/heads/main'
# run: |
# echo "TODO - CHECK IT"
# exit 1
# make docker-login \
# DOCKER_REGISTRY=${{ needs.params.outputs.docker_registry }} \
# DOCKER_USER=${{ needs.params.outputs.docker_user }} \
# DOCKER_PW=${{ secrets.DOCKERHUB_PASSWORD }}
#
# make docker-push \
# ACTION_SERVER_DOCKERPATH=${{ steps.action_server.outputs.docker_image_full_name }}
# - name: Push docker image to docker.io/rasa, when on main
# if: |
# github.ref == 'refs/heads/main' || github.head_ref == 'refs/heads/main'
# run: |
# echo "TODO - CHECK IT"
# exit 1
# make docker-login \
# DOCKER_REGISTRY=${{ needs.params.outputs.docker_registry }} \
# DOCKER_USER=${{ needs.params.outputs.docker_user }} \
# DOCKER_PW=${{ secrets.DOCKERHUB_PASSWORD }}
#
# make docker-push \
# ACTION_SERVER_DOCKERPATH=${{ steps.action_server.outputs.docker_image_full_name }}

rasa_model:
name: rasa_model (to AWS S3)
Expand Down Expand Up @@ -274,102 +279,89 @@ jobs:
make aws-s3-copy-rasa-model \
RASA_MODEL_PATH=${{ needs.params.outputs.rasa_model_path }}
aws-infra:
name: aws-infra
aws-eks-create:
name: aws-eks-create
runs-on: ubuntu-latest
needs: [params, action_server, rasa_model]
# TODO: REMOVE THIS LINE -- FOR DEVELOPMENT PURPOSES, ALWAYS RUN THIS...
if: always()
steps:
- run: |
exit 1
- name: checkout
uses: actions/checkout@v2

- name: Configure AWS Credentials
if: ${{ needs.params.outputs.aws_eks_create == 'true' }}
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ needs.params.outputs.aws_region }}

- name: aws-deploy-stack
- name: aws-eks-create
if: ${{ needs.params.outputs.aws_eks_create == 'true' }}
run: |
make aws-deploy-stack \
STACK_NAME=${{ needs.params.outputs.aws_stack_name }} \
STACK_TYPE=${{ needs.params.outputs.aws_stack_type }}
echo "TO BE IMPLEMENTED"
exit 1
make aws-eks-create ....
aws-rasa-x:
name: aws-rasa-x
runs-on: ubuntu-latest
needs: [params, aws-infra]
steps:
- run: echo "TO BE IMPLEMENTED"

aws-deploy-action-server:
name: aws-deploy-action-server
runs-on: ubuntu-latest
needs: [params, aws-rasa-x]
steps:
- run: echo "TO BE IMPLEMENTED"

aws-deploy-model:
name: aws-deploy-model
runs-on: ubuntu-latest
needs: [params, aws-deploy-action-server]
steps:
- run: echo "TO BE IMPLEMENTED"

aws-smoketest:
name: aws-smoketest
aws-eks-namespace-test:
name: aws-eks-namespace-test
runs-on: ubuntu-latest
needs: [params, aws-deploy-model]
needs: [params, aws-eks-create]
# TODO: REMOVE THIS LINE -- FOR DEVELOPMENT PURPOSES, ALWAYS RUN THIS...
if: always()
steps:
- run: echo "TO BE IMPLEMENTED"
- name: Create namespace
run: |
echo "TO BE IMPLEMENTED"
exit 1
- name: Create pull secret
run: |
echo "TO BE IMPLEMENTED"
exit 1
- name: Deploy same as PROD
run: |
echo "TO BE IMPLEMENTED"
exit 1
- name: Smoketest
run: |
echo "TO BE IMPLEMENTED"
exit 1
- name: Upgrade to new
run: |
echo "TO BE IMPLEMENTED"
exit 1
- name: Smoketest
run: |
echo "TO BE IMPLEMENTED"
exit 1
- name: Cleanup
if: ${{ env.AWS_EKS_DELETE_NAMESPACE_TEST }}
run: |
echo "TO BE IMPLEMENTED"
exit 1
aws-cleanup:
name: aws-cleanup
aws-eks-namespace-prod:
name: aws-eks-namespace-prod
runs-on: ubuntu-latest
needs: [params, aws-smoketest]
needs: [params, aws-eks-namespace-test]
steps:
- run: echo "TO BE IMPLEMENTED"

gcp-prod-upgrade:
name: gcp-prod-upgrade
runs-on: ubuntu-latest
needs: [params, aws-smoketest]
steps:
- name: set_upgrade_prod
if: |
!(github.ref == 'refs/heads/main'
|| github.head_ref == 'refs/heads/main')
run: echo "UPGRADE_PROD=true" >> $GITHUB_ENV

- name: Upgrade prod
if: env.UPGRADE_PROD == 'true'
run: echo "TO BE IMPLEMENTED"

- name: Upgrade prod more
run: echo "TO BE IMPLEMENTED MORE"

gcp-prod-smoketest:
name: gcp-prod-smoketest
runs-on: ubuntu-latest
needs: [params, gcp-prod-upgrade]
steps:
- name: Smoketest prod
if: env.UPGRADE_PROD == 'true'
run: echo "TO BE IMPLEMENTED"

- name: Smoketest prod more
run: echo "TO BE IMPLEMENTED MORE"
- run: |
echo "TO BE IMPLEMENTED"
exit 1
# TODO:
# (-) reset config.yml epochs for DIET & TED
# (-) Remove all the... if: always()
# (-) in rasa_model, reset to true: data_validate, cross_validation & publish_summary
# (-) Cleanup of infrastructure if an aws-sit steps fail
# https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#needs-context
# (-) Delete docker image after successfull
# (-) Send a slack message once gcp-prod has been upgraded
# (-) Roll-back gcp-prod (= redeploy the backup) if gcp-prod-smoketest failed
# (-) Use aws-sagemaker-gpu container to train the rasa model
# (-) Makefile & Dockerfile to extract rasa_sdk version from requirements.txt
# (-) Clean up Makefile help

0 comments on commit 27297ad

Please sign in to comment.