Skip to content

Commit

Permalink
FS-4605: Deploy Designer in AWS (#23)
Browse files Browse the repository at this point in the history
* edited the redis name

* added the latest image to the manifest file

* added the designer service to the folder

* changed port number

* added new lines

* added new code to the workflow folder

* deleted the variables
  • Loading branch information
Tiny49 authored Sep 3, 2024
1 parent 4c3093d commit b6e2ffd
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 8 deletions.
35 changes: 27 additions & 8 deletions .github/workflows/copilot_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,20 +157,39 @@ jobs:

dev_deploy:
strategy:
matrix:
include:
- deployment: fsd-form-runner-adapter
command: svc
- deployment: fsd-form-designer-adapter
command: svc
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
needs: [ docker-build, setup ]
needs: [ docker-build-designer, docker-build, setup ]
if: ${{ always() && contains(fromJSON(needs.setup.outputs.jobs_to_run), 'dev') && (! contains(needs.*.result, 'failure') ) && (! contains(needs.*.result, 'cancelled') ) }}
runs-on: ubuntu-latest
environment: ${{ inputs.copilot_environment || 'test' }}
steps:
- name: Git clone the repository
uses: actions/checkout@v4

uses: communitiesuk/funding-service-design-workflows/.github/workflows/standard-deploy.yml@main
secrets:
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }}
with:
environment: dev
app_name: "form-runner-adapter"
version: sha-${{ github.sha }}
- name: Setup Copilot
uses: communitiesuk/funding-service-design-workflows/.github/actions/copilot_setup@main
with:
copilot_environment: ${{ inputs.copilot_environment || 'test' }}
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }}

- name: Inject env specific values into manifest
run: |
yq -i '.variables.GITHUB_SHA = "${{ github.sha }}"' copilot/${{ matrix.deployment }}/manifest.yml
yq -i '.image.location = "${{ inputs.image_location }}"' copilot/${{ matrix.deployment }}/manifest.yml
- name: Copilot deploy ${{ matrix.deployment }}
run: |
copilot ${{ matrix.command }} deploy --name ${{ matrix.deployment }}
post_dev_deploy_tests:
needs: [ dev_deploy ]

Expand Down
107 changes: 107 additions & 0 deletions copilot/fsd-form-designer-adapter/manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# The manifest for the "form-runner-adapter" service.
# Read the full specification for the "Load Balanced Web Service" type at:
# https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/
name: "fsd-form-designer-adapter"
type: "Load Balanced Web Service"

# Distribute traffic to your service.
http:
# Requests to this path will be forwarded to your service.
# To match all requests you can use the "/" path.
path: "/"
# You can specify a custom health check path. The default is "/".
healthcheck: "/health-check"
#alias: forms.${COPILOT_ENVIRONMENT_NAME}.access-funding.test.levellingup.gov.uk

# Configuration for your containers and service.
image:
# Docker build arguments. For additional overrides: https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/#image-build
location: ghcr.io/communitiesuk/funding-service-design-form-designer-adapter:sha-cccc66669421661022a707428d58d9eefb4c813c
# Port exposed through your container to route traffic to it.
port: 3000

# Valid values: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-cpu-memory-error.html
# Number of CPU units for the task.
cpu: 1024
# Amount of memory in MiB used by the task.
memory: 2048

# See https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/#platform
platform: linux/x86_64

# Number of tasks that should be running in your service.
count: 1

# Enable running commands in your container.
exec: true

network:
connect: true # Enable Service Connect for intra-environment traffic between services.

# Override the network configuration with the public/private/data subnets built using terraform
# notification should be private (internal)
# vpc:
# placement:
# subnets: ["subnet-04851bdddcd8f5bbc", "subnet-0178ac1212c96b6c4"]

# storage:
# readonly_fs: true # Limit to read-only access to mounted root filesystems.

# Optional fields for more advanced use-cases.
#
# Pass environment variables as key value pairs.
variables:
ACCESSIBILITY_STATEMENT_URL: "https://frontend.${COPILOT_ENVIRONMENT_NAME}.access-funding.test.levellingup.gov.uk/accessibility_statement"
AWS_BUCKET_NAME:
from_cfn: ${COPILOT_APPLICATION_NAME}-${COPILOT_ENVIRONMENT_NAME}-FormUploadsBucket
BASIC_AUTH_ON: false
CONTACT_US_URL: "https://frontend.${COPILOT_ENVIRONMENT_NAME}.access-funding.test.levellingup.gov.uk/contact_us"
COOKIE_POLICY_URL: "https://frontend.${COPILOT_ENVIRONMENT_NAME}.access-funding.test.levellingup.gov.uk/cookie_policy"
FEEDBACK_LINK: "https://frontend.${COPILOT_ENVIRONMENT_NAME}.access-funding.test.levellingup.gov.uk/feedback"
JWT_REDIRECT_TO_AUTHENTICATION_URL: "https://authenticator.${COPILOT_ENVIRONMENT_NAME}.access-funding.test.levellingup.gov.uk/sessions/sign-out"
LOGOUT_URL: "https://authenticator.${COPILOT_ENVIRONMENT_NAME}.access-funding.test.levellingup.gov.uk/sessions/sign-out"
MULTIFUND_URL: "https://frontend.${COPILOT_ENVIRONMENT_NAME}.access-funding.test.levellingup.gov.uk/account"
NODE_CONFIG: '{"safelist": ["fsd-application-store"]}'
NODE_ENV: production
PRIVACY_POLICY_URL: "https://frontend.${COPILOT_ENVIRONMENT_NAME}.access-funding.test.levellingup.gov.uk/privacy"
SERVICE_START_PAGE: "https://frontend.${COPILOT_ENVIRONMENT_NAME}.access-funding.test.levellingup.gov.uk/account"
SINGLE_REDIS: true
JWT_AUTH_COOKIE_NAME: "fsd_user_token"
ELIGIBILITY_RESULT_URL: "https://frontend.${COPILOT_ENVIRONMENT_NAME}.access-funding.test.levellingup.gov.uk/eligibility-result"

secrets:
RSA256_PUBLIC_KEY_BASE64: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/RSA256_PUBLIC_KEY_BASE64
SESSION_COOKIE_PASSWORD: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/SESSION_COOKIE_PASSWORD

# You can override any of the values defined above by environment.
environments:
dev:
count:
spot: 1
test:
deployment:
rolling: "recreate"
count:
spot: 2
variables:
ACCESSIBILITY_STATEMENT_URL: "https://frontend.access-funding.levellingup.gov.uk/accessibility_statement"
BASIC_AUTH_ON: false
CONTACT_US_URL: "https://frontend.access-funding.levellingup.gov.uk/contact_us"
COOKIE_POLICY_URL: "https://frontend.access-funding.levellingup.gov.uk/cookie_policy"
FEEDBACK_LINK: "https://frontend.access-funding.levellingup.gov.uk/feedback"
JWT_REDIRECT_TO_AUTHENTICATION_URL: "https://authenticator.access-funding.levellingup.gov.uk/sessions/sign-out"
LOGOUT_URL: "https://authenticator.access-funding.levellingup.gov.uk/sessions/sign-out"
MULTIFUND_URL: "https://frontend.access-funding.levellingup.gov.uk/account"
PRIVACY_POLICY_URL: "https://frontend.access-funding.levellingup.gov.uk/privacy"
SERVICE_START_PAGE: "https://frontend.access-funding.levellingup.gov.uk/account"
ELIGIBILITY_RESULT_URL: "https://frontend.access-funding.levellingup.gov.uk/eligibility-result"
count:
range: 2-4
cooldown:
in: 60s
out: 30s
cpu_percentage:
value: 70
memory_percentage:
value: 80
requests: 30

0 comments on commit b6e2ffd

Please sign in to comment.