Skip to content

Commit

Permalink
slight patches
Browse files Browse the repository at this point in the history
  • Loading branch information
philippemnoel authored and philippemnoel committed Nov 24, 2020
1 parent 6799555 commit e6c3373
Show file tree
Hide file tree
Showing 32 changed files with 423 additions and 709 deletions.
17 changes: 8 additions & 9 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
# Order is important. The last matching pattern has the most precedence.
# The folders are ordered as follows:

/client-applications/ @mingy98 @philippemnoel @fractal/code-standard-reviewers
/container-images/ @rpadaki @djsavvy @philippemnoel @fractal/code-standard-reviewers
/ecs-host-service/ @rpadaki @djsavvy @fractal/code-standard-reviewers
/ecs-host-setup/ @rpadaki @djsavvy @fractal/code-standard-reviewers
/ecs-task-definitions/ @rpadaki @djsavvy @fractal/code-standard-reviewers
/log-analysis/ @rpadaki @djsavvy @fractal/code-standard-reviewers
/main-webserver/ @mingy98 @FishmanL @fractal/code-standard-reviewers
/protocol/ @npip99 @rpadaki @fractal/code-standard-reviewers
/client-applications/ @fractal/code-standard-reviewers @mingy98 @philippemnoel
/container-images/ @fractal/code-standard-reviewers @djsavvy @rpadaki @philippemnoel
/ecs-host-service/ @fractal/code-standard-reviewers @djsavvy @rpadaki
/ecs-host-setup/ @fractal/code-standard-reviewers @rpadaki @djsavvy
/ecs-task-definitions/ @fractal/code-standard-reviewers @rpadaki @djsavvy
/log-analysis/ @fractal/code-standard-reviewers @rpadaki @philippemnoel
/main-webserver/ @fractal/code-standard-reviewers @FishmanL @mingy98
/protocol/ @fractal/code-standard-reviewers @npip99 @rpadaki

# In each subsection folders are ordered first by depth, then alphabetically.
# This should make it easy to add new rules without breaking existing ones.

9 changes: 4 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
---
name: Bug Report
about: Report a bug related to this project
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Bug Description**
A clear and concise description of what the bug is.

**How to Reproduce**
A list of steps to reproduce the bug, if it is reproducible.
A list of steps to reproduce the bug, if it is reproducible.

**Context**
List your computer OS, specifications, browser version, etc.; anything that might be relevant to reproducing and diagnosing the bug.
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: New Feature
about: Describe a new feature to improve this project
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Feature Name & Description**
Expand Down
7 changes: 2 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ Briefly describe your approach, design, implementation to solve the problem if a

## Tests

List all the possible scenarios/edge cases that you tested. For instance, if you implemented a login feature, you could say that you tested:
1. Correct username/password
2. Correct username but incorrect password
3. Correct username and admin password
List all the possible scenarios/edge cases that you tested.

## Checklist

- [ ] Appropriate Unit test coverage
- [ ] Appropriate unit test coverage
- [ ] Manual testing has been performed
- [ ] This PR is linted, tested and follows the best practices of the organization
4 changes: 2 additions & 2 deletions .github/workflows/client-applications-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: Lint client-applications

on:
pull_request:
branches: [ master, dev ]
branches: [master, dev]
paths:
- '/client-applications/**'
- "/client-applications/**"

jobs:
lint:
Expand Down
46 changes: 23 additions & 23 deletions .github/workflows/container-images-build-dockerfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@ name: Container-Images Build Dockerfiles

on:
pull_request:
branches: [ master, dev ]
branches: [master, dev]
paths:
- '/container-images/**'
- "/container-images/**"

jobs:
build-dockerfiles:
name: Build Dockerfiles
runs-on: ubuntu-20.04
build-dockerfiles:
name: Build Dockerfiles
runs-on: ubuntu-20.04

steps:
- name: Checkout Git repository
uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
token: ${{ secrets.GHA_PERSONAL_ACCESS_TOKEN }}
submodules: recursive
steps:
- name: Checkout Git repository
uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
token: ${{ secrets.GHA_PERSONAL_ACCESS_TOKEN }}
submodules: recursive

- name: Walk repo to find all dockerfiles and store path as env variable
run: echo "apps=$(./container-images/find_images_in_git_repo.sh)" >> $GITHUB_ENV
- name: Walk repo to find all dockerfiles and store path as env variable
run: echo "apps=$(./container-images/find_images_in_git_repo.sh)" >> $GITHUB_ENV

- name: Build debug protocol
run: ./container-images/build_protocol.sh
- name: Build debug protocol
run: ./container-images/build_protocol.sh

- name: Build container images
run: |
for app in ${{ env.apps }}
do
./container-images/build_container_image.sh $app
done
- name: Build container images
run: |
for app in ${{ env.apps }}
do
./container-images/build_container_image.sh $app
done
132 changes: 66 additions & 66 deletions .github/workflows/container-images-push-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,82 +3,82 @@ name: Container-Images Push images

# Publish on update to master branch
on:
push:
branches: [master]
paths:
- '/container-images/**'
push:
branches: [master]
paths:
- "/container-images/**"

env:
aws-placeholder-region: us-east-1
aws-regions: >
us-east-1
us-east-2
us-west-1
us-west-2
ca-central-1
aws-placeholder-region: us-east-1
aws-regions: >
us-east-1
us-east-2
us-west-1
us-west-2
ca-central-1
jobs:
ecr-push:
name: Build and push to AWS ECR
runs-on: ubuntu-20.04
ecr-push:
name: Build and push to AWS ECR
runs-on: ubuntu-20.04

steps:
- name: Checkout Git repository
uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
token: ${{ secrets.GHA_PERSONAL_ACCESS_TOKEN }}
submodules: recursive
steps:
- name: Checkout Git repository
uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
token: ${{ secrets.GHA_PERSONAL_ACCESS_TOKEN }}
submodules: recursive

- name: Configure AWS CLI
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ECR_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_ECR_SECRET_ACCESS_KEY }}
aws-region: ${{ env.aws-placeholder-region }}
- name: Configure AWS CLI
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ECR_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_ECR_SECRET_ACCESS_KEY }}
aws-region: ${{ env.aws-placeholder-region }}

- name: Walk repo to find all dockerfiles and store path as env variable
run: echo "apps=$(./container-images/find_images_in_git_repo.sh)" >> $GITHUB_ENV
- name: Walk repo to find all dockerfiles and store path as env variable
run: echo "apps=$(./container-images/find_images_in_git_repo.sh)" >> $GITHUB_ENV

- name: Build release protocol
run: ./container-images/build_protocol.sh release
- name: Build release protocol
run: ./container-images/build_protocol.sh release

- name: Build container images
run: |
for app in ${{ env.apps }}
do
./container-images/build_container_image.sh $app
done
- name: Build container images
run: |
for app in ${{ env.apps }}
do
./container-images/build_container_image.sh $app
done
- name: Push container images
run: |
for region in ${{ env.aws-regions }}
do
for app in ${{ env.apps }}
do
./container-images/push_container_image.sh $app $region
done
done
- name: Push container images
run: |
for region in ${{ env.aws-regions }}
do
for app in ${{ env.apps }}
do
./container-images/push_container_image.sh $app $region
done
done
- name: Create Lifecycle Policies for each image, only keeps latest 10
run: |
for region in ${{ env.aws-regions }}
do
for app in ${{ env.apps }}
do
./container-images/apply_ecr_lifecycle_policy.sh $app $region
done
done
- name: Create Lifecycle Policies for each image, only keeps latest 10
run: |
for region in ${{ env.aws-regions }}
do
for app in ${{ env.apps }}
do
./container-images/apply_ecr_lifecycle_policy.sh $app $region
done
done
- name: Notify Slack
run: |
curl -X POST \
--data-urlencode "payload={\"channel\": \"#alerts\", \"username\": \"Fractal Bot\", \"text\": \"Container images builds pushed to production via Docker push to ECR.\", \"icon_emoji\": \":fractal:\"}" \
https://hooks.slack.com/services/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
- name: Notify Slack
run: |
curl -X POST \
--data-urlencode "payload={\"channel\": \"#alerts\", \"username\": \"Fractal Bot\", \"text\": \"Container images builds pushed to production via Docker push to ECR.\", \"icon_emoji\": \":fractal:\"}" \
https://hooks.slack.com/services/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
# secrets.ECS_TASK_DEFINITIONS_RENDER_AND_DEPLOY_WORKFLOW_ID is the ID of that specific .yml file in ecs-task-definitions.
# It was retrieve via a Curl request and stored into GitHub secrets for this repository. See Notion -> Engineering Wiki for more details
- name: Trigger a ECS task definitions render and deployment
run: |
echo "Trigger render_and_deploy.yml on the main branch of ecs-task-definitions to update tags to our latest container images"
curl -X POST -H "Authorization: Bearer ${{ secrets.GHA_PERSONAL_ACCESS_TOKEN }}" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/fractalcomputers/ecs-task-definitions/actions/workflows/${{ secrets.ECS_TASK_DEFINITIONS_RENDER_AND_DEPLOY_WORKFLOW_ID }}/dispatches -d '{"ref": "main"}'
# secrets.ECS_TASK_DEFINITIONS_RENDER_AND_DEPLOY_WORKFLOW_ID is the ID of that specific .yml file in ecs-task-definitions.
# It was retrieve via a Curl request and stored into GitHub secrets for this repository. See Notion -> Engineering Wiki for more details
- name: Trigger a ECS task definitions render and deployment
run: |
echo "Trigger render_and_deploy.yml on the main branch of ecs-task-definitions to update tags to our latest container images"
curl -X POST -H "Authorization: Bearer ${{ secrets.GHA_PERSONAL_ACCESS_TOKEN }}" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/fractal/ecs-task-definitions/actions/workflows/${{ secrets.ECS_TASK_DEFINITIONS_RENDER_AND_DEPLOY_WORKFLOW_ID }}/dispatches -d '{"ref": "main"}'
88 changes: 44 additions & 44 deletions .github/workflows/ecs-host-service-publish-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,51 @@ name: Publish ECS Host Service builds

# Publish on update to master branch
on:
push:
branches: [master]
paths:
- '/ecs-host-service/**'
- '!/ecs-host-service/README.md'
push:
branches: [master]
paths:
- "/ecs-host-service/**"
- "!/ecs-host-service/README.md"

env:
binary-location: ecs-host-service/build
binary-name: ecs-host-service
s3-bucket-region: us-east-1 # eventually, we should replicate s3 per region
s3-bucket-uri: s3://fractal-ecs-host-service
binary-location: ecs-host-service/build
binary-name: ecs-host-service
s3-bucket-region: us-east-1 # eventually, we should replicate s3 per region
s3-bucket-uri: s3://fractal-ecs-host-service

jobs:
s3-publish:
name: Build and publish to AWS S3
runs-on: ubuntu-latest

steps:
- name: Checkout git repository
uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo

- name: Setup Go environment
uses: actions/setup-go@v2.1.3

- name: Configure AWS CLI
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
aws-region: ${{ env.s3-bucket-region }}

- name: Install Go dependencies
run: cd ecs-host-service && make deps

- name: Build Go project
run: cd ecs-host-service && make build

- name: Upload binary to S3
run: aws s3 cp ${{ env.binary-location }}/${{ env.binary-name }} ${{ env.s3-bucket-uri }}/${{ env.binary-name }}

- name: Notify Slack
run: |
curl -X POST \
--data-urlencode "payload={\"channel\": \"#alerts\", \"username\": \"Fractal Bot\", \"text\": \"ECS Host Service build pushed to production via S3 upload.\", \"icon_emoji\": \":fractal:\"}" \
https://hooks.slack.com/services/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
s3-publish:
name: Build and publish to AWS S3
runs-on: ubuntu-latest

steps:
- name: Checkout git repository
uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo

- name: Setup Go environment
uses: actions/setup-go@v2.1.3

- name: Configure AWS CLI
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
aws-region: ${{ env.s3-bucket-region }}

- name: Install Go dependencies
run: cd ecs-host-service && make deps

- name: Build Go project
run: cd ecs-host-service && make build

- name: Upload binary to S3
run: aws s3 cp ${{ env.binary-location }}/${{ env.binary-name }} ${{ env.s3-bucket-uri }}/${{ env.binary-name }}

- name: Notify Slack
run: |
curl -X POST \
--data-urlencode "payload={\"channel\": \"#alerts\", \"username\": \"Fractal Bot\", \"text\": \"ECS Host Service build pushed to production via S3 upload.\", \"icon_emoji\": \":fractal:\"}" \
https://hooks.slack.com/services/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
Loading

0 comments on commit e6c3373

Please sign in to comment.