Skip to content

Commit 7deddf2

Browse files
committed
Remove Good Job from infrastructure
This removes references to Good Job from the infrastructure code as it is no longer being used. Jira-Issue: MAV-1948
1 parent 7cf88f6 commit 7deddf2

File tree

12 files changed

+4
-100
lines changed

12 files changed

+4
-100
lines changed

.github/workflows/deploy-application.yml

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ on:
2323
options:
2424
- all
2525
- web
26-
- good-job
2726
- sidekiq
2827
default: all
2928
workflow_call:
@@ -82,8 +81,6 @@ jobs:
8281
"application=" + .codedeploy_application_name.value,
8382
"application_group=" + .codedeploy_deployment_group_name.value,
8483
"cluster_name=" + .ecs_variables.value.cluster_name,
85-
"good_job_service=" + .ecs_variables.value.good_job.service_name,
86-
"good_job_task_definition=" + .ecs_variables.value.good_job.task_definition.arn,
8784
"sidekiq_service=" + .ecs_variables.value.sidekiq.service_name,
8885
"sidekiq_task_definition=" + .ecs_variables.value.sidekiq.task_definition.arn
8986
' > ${{ runner.temp }}/DEPLOYMENT_ENVS
@@ -126,50 +123,6 @@ jobs:
126123
aws deploy wait deployment-successful --deployment-id "$deployment_id"
127124
echo "Deployment successful"
128125
129-
create-good-job-deployment:
130-
name: Create good-job deployment
131-
runs-on: ubuntu-latest
132-
needs: prepare-deployment
133-
if: inputs.server_types == 'good-job' || inputs.server_types == 'all'
134-
permissions:
135-
id-token: write
136-
steps:
137-
- name: Download Artifact
138-
uses: actions/download-artifact@v5
139-
with:
140-
name: DEPLOYMENT_ENVS-${{ inputs.environment }}
141-
path: ${{ runner.temp }}
142-
- name: Configure AWS Credentials
143-
uses: aws-actions/configure-aws-credentials@v5
144-
with:
145-
role-to-assume: ${{ env.aws-role }}
146-
aws-region: eu-west-2
147-
- name: Trigger ECS Deployment
148-
run: |
149-
set -e
150-
source ${{ runner.temp }}/DEPLOYMENT_ENVS
151-
DEPLOYMENT_ID=$(aws ecs update-service --cluster $cluster_name --service $good_job_service \
152-
--task-definition $good_job_task_definition --force-new-deployment \
153-
--query 'service.deployments[?rolloutState==`IN_PROGRESS`].[id][0]' --output text)
154-
echo "Deployment started: $DEPLOYMENT_ID"
155-
echo "deployment_id=$DEPLOYMENT_ID" >> $GITHUB_ENV
156-
- name: Wait for deployment to complete
157-
run: |
158-
set -e
159-
source ${{ runner.temp }}/DEPLOYMENT_ENVS
160-
DEPLOYMENT_STATE=IN_PROGRESS
161-
while [ "$DEPLOYMENT_STATE" == "IN_PROGRESS" ]; do
162-
echo "Waiting for deployment to complete..."
163-
sleep 30
164-
DEPLOYMENT_STATE="$(aws ecs describe-services --cluster $cluster_name --services $good_job_service \
165-
--query "services[0].deployments[?id == \`$deployment_id\`].[rolloutState][0]" --output text)"
166-
done
167-
if [ "$DEPLOYMENT_STATE" != "COMPLETED" ]; then
168-
echo "Deployment failed with state: $DEPLOYMENT_STATE"
169-
exit 1
170-
fi
171-
echo "Deployment successful"
172-
173126
create-sidekiq-deployment:
174127
name: Create sidekiq deployment
175128
runs-on: ubuntu-latest

.github/workflows/deploy.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ on:
4040
options:
4141
- all
4242
- web
43-
- good-job
4443
- sidekiq
4544
- none
4645
default: all

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,5 @@ VOLUME ["/rails/db/data", "/rails/tmp", "/rails/log", "/tmp", "/var/log", "/var/
8585
# Start web server by default, this can be overwritten by environment variable
8686
EXPOSE 4000
8787
ENV HTTP_PORT=4000
88-
ENV GOOD_JOB_PROBE_PORT=4000
8988
ENV SERVER_TYPE=web
9089
CMD ["./bin/docker-start"]

bin/docker-start

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@ BIN_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
55
if [ "$SERVER_TYPE" == "web" ]; then
66
echo "Starting web server..."
77
exec "$BIN_DIR"/thrust "$BIN_DIR"/rails server
8-
elif [ "$SERVER_TYPE" == "good-job" ]; then
9-
echo "Starting good-job server..."
10-
exec "$BIN_DIR"/good_job start
118
elif [ "$SERVER_TYPE" == "sidekiq" ]; then
129
echo "Starting sidekiq server..."
1310
exec "$BIN_DIR"/sidekiq
1411
elif [ "$SERVER_TYPE" == "none" ]; then
1512
echo "No server started"
1613
exec tail -f /dev/null # Keep container running
1714
else
18-
echo "SERVER_TYPE variable: '$SERVER_TYPE' unknown. Allowed values ['web','good-job', 'none']"
15+
echo "SERVER_TYPE variable: '$SERVER_TYPE' unknown. Allowed values: web, sidekiq, none"
1916
exit 1
2017
fi

bin/good_job

Lines changed: 0 additions & 5 deletions
This file was deleted.

config/database.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
default: &default
22
adapter: postgresql
33
encoding: unicode
4-
pool: <%= ENV.fetch("RAILS_MAX_THREADS", 5).to_i + ENV.fetch("GOOD_JOB_MAX_THREADS", 4).to_i + ENV.fetch("SIDEKIQ_CONCURRENCY", 4).to_i %>
4+
pool: <%= ENV.fetch("RAILS_MAX_THREADS", 5).to_i + ENV.fetch("SIDEKIQ_CONCURRENCY", 4).to_i %>
55

66
development:
77
<<: *default

docs/terraform.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,6 @@ tf apply -var-file=env/$env.tfvars -var="image_digest=<image_digest_from_ECR>"
106106
```
107107

108108
Step 3: Run Codedeploy from the AWS Console
109-
Step 4: If needed, trigger a deployment for the good-job service from the AWS ECS Console
109+
Step 4: If needed, trigger a deployment for the sidekiq service from the AWS ECS Console
110110

111111
For a more high-level description of the process see [deployment-process.md](../terraform/documentation/deployment-process.md)

terraform/app/ecs.tf

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -58,32 +58,6 @@ module "web_service" {
5858
deployment_controller = "CODE_DEPLOY"
5959
}
6060

61-
module "good_job_service" {
62-
source = "./modules/ecs_service"
63-
task_config = {
64-
environment = local.task_envs
65-
secrets = local.task_secrets
66-
cpu = 1024
67-
memory = 2048
68-
docker_image = "${var.account_id}.dkr.ecr.eu-west-2.amazonaws.com/${var.docker_image}@${var.image_digest}"
69-
execution_role_arn = aws_iam_role.ecs_task_execution_role.arn
70-
task_role_arn = aws_iam_role.ecs_task_role.arn
71-
log_group_name = aws_cloudwatch_log_group.ecs_log_group.name
72-
region = var.region
73-
health_check_command = ["CMD-SHELL", "./bin/internal_healthcheck http://localhost:4000/status/connected"]
74-
}
75-
network_params = {
76-
subnets = [aws_subnet.private_subnet_a.id, aws_subnet.private_subnet_b.id]
77-
vpc_id = aws_vpc.application_vpc.id
78-
}
79-
minimum_replica_count = var.good_job_replicas
80-
maximum_replica_count = var.good_job_replicas
81-
cluster_id = aws_ecs_cluster.cluster.id
82-
cluster_name = aws_ecs_cluster.cluster.name
83-
environment = var.environment
84-
server_type = "good-job"
85-
}
86-
8761
module "sidekiq_service" {
8862
source = "./modules/ecs_service"
8963
task_config = {

terraform/app/env/sandbox-alpha.tfvars

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ minimum_web_replicas = 1
2121
maximum_web_replicas = 2
2222
minimum_sidekiq_replicas = 1
2323
maximum_sidekiq_replicas = 2
24-
good_job_replicas = 1
2524

2625
valkey_node_type = "cache.t4g.micro"
2726
valkey_log_retention_days = 3

terraform/app/env/sandbox-beta.tfvars

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ minimum_web_replicas = 1
2121
maximum_web_replicas = 2
2222
minimum_sidekiq_replicas = 1
2323
maximum_sidekiq_replicas = 2
24-
good_job_replicas = 1
2524

2625
# Valkey serverless configuration - minimal settings for sandbox
2726
valkey_node_type = "cache.t4g.micro"

0 commit comments

Comments
 (0)