Skip to content

Commit

Permalink
chore: Upgrade MySQL to 8.0 (#577)
Browse files Browse the repository at this point in the history
  • Loading branch information
niallthomson committed Jul 11, 2024
1 parent 35c1f0d commit 8286041
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 24 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This is a sample application designed to illustrate various concepts related to containers on AWS. It presents a sample retail store application including a product catalog, shopping cart and checkout.

It provides:

- A distributed component architecture in various languages and frameworks
- Utilization of a variety of different persistence backends for different components like MySQL, DynamoDB and Redis
- The ability to run in various container orchestration technologies like Docker Compose, Kubernetes etc.
Expand All @@ -21,14 +22,14 @@ The application has been deliberately over-engineered to generate multiple de-co

![Architecture](/docs/images/architecture.png)

| Component | Language | Container Image | Description |
|-----------|----------|---------------------|-----------------------------------------------------------------------------|
| ![ui workflow](https://github.com/aws-containers/retail-store-sample-app/actions/workflows/ci-ui.yml/badge.svg) | Java | [Link](https://gallery.ecr.aws/aws-containers/retail-store-sample-ui) | Aggregates API calls to the various other services and renders the HTML UI. |
| Component | Language | Container Image | Description |
| --------------------------------------------------------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| ![ui workflow](https://github.com/aws-containers/retail-store-sample-app/actions/workflows/ci-ui.yml/badge.svg) | Java | [Link](https://gallery.ecr.aws/aws-containers/retail-store-sample-ui) | Aggregates API calls to the various other services and renders the HTML UI. |
| ![catalog workflow](https://github.com/aws-containers/retail-store-sample-app/actions/workflows/ci-catalog.yml/badge.svg) | Go | [Link](https://gallery.ecr.aws/aws-containers/retail-store-sample-catalog) | Product catalog API |
| ![cart workflow](https://github.com/aws-containers/retail-store-sample-app/actions/workflows/ci-cart.yml/badge.svg) | Java | [Link](https://gallery.ecr.aws/aws-containers/retail-store-sample-cart) | User shopping carts API |
| ![orders workflow](https://github.com/aws-containers/retail-store-sample-app/actions/workflows/ci-orders.yml/badge.svg) | Java | [Link](https://gallery.ecr.aws/aws-containers/retail-store-sample-orders) | User orders API |
| ![cart workflow](https://github.com/aws-containers/retail-store-sample-app/actions/workflows/ci-cart.yml/badge.svg) | Java | [Link](https://gallery.ecr.aws/aws-containers/retail-store-sample-cart) | User shopping carts API |
| ![orders workflow](https://github.com/aws-containers/retail-store-sample-app/actions/workflows/ci-orders.yml/badge.svg) | Java | [Link](https://gallery.ecr.aws/aws-containers/retail-store-sample-orders) | User orders API |
| ![checkout workflow](https://github.com/aws-containers/retail-store-sample-app/actions/workflows/ci-checkout.yml/badge.svg) | Node | [Link](https://gallery.ecr.aws/aws-containers/retail-store-sample-checkout) | API to orchestrate the checkout process |
| ![assets workflow](https://github.com/aws-containers/retail-store-sample-app/actions/workflows/ci-assets.yml/badge.svg) | Nginx | [Link](https://gallery.ecr.aws/aws-containers/retail-store-sample-assets) | Serves static assets like images related to the product catalog |
| ![assets workflow](https://github.com/aws-containers/retail-store-sample-app/actions/workflows/ci-assets.yml/badge.svg) | Nginx | [Link](https://gallery.ecr.aws/aws-containers/retail-store-sample-assets) | Serves static assets like images related to the product catalog |

## Quickstart

Expand All @@ -39,6 +40,7 @@ The following sections provide quickstart instructions for various platforms. Al
This deployment method will run the application in an existing Kubernetes cluster.

Pre-requisites:

- Kubernetes cluster
- `kubectl` installed locally

Expand Down Expand Up @@ -66,6 +68,7 @@ kubectl delete -f https://raw.githubusercontent.com/aws-containers/retail-store-
This deployment method will run the application on your local machine using `docker-compose`, and will build the containers as part of the deployment.

Pre-requisites:

- Docker installed locally

Change directory to the Docker Compose deploy directory:
Expand Down Expand Up @@ -127,4 +130,4 @@ DEPENDENCIES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, EVEN
IF AMAZON HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
AND DISCLAIMERS APPLY EXCEPT TO THE EXTENT PROHIBITED BY APPLICABLE LAW.

MySQL Community Edition - [LICENSE](https://github.com/mysql/mysql-server/blob/5.7/LICENSE)
MySQL Community Edition - [LICENSE](https://github.com/mysql/mysql-server/blob/8.0/LICENSE)
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ spec:
secretKeyRef:
name: {{ .Values.mysql.secret.name }}
key: password
args:
- "--ignore-db-dir=lost+found"
volumeMounts:
- name: data
mountPath: /var/lib/mysql
Expand Down
6 changes: 3 additions & 3 deletions deploy/kubernetes/charts/catalog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ mysql:
image:
repository: public.ecr.aws/docker/library/mysql
pullPolicy: IfNotPresent
tag: "5.7"
tag: "8.0"

service:
type: ClusterIP
Expand All @@ -108,7 +108,7 @@ mysql:
annotations: {}
labels: {}
accessModes:
- ReadWriteOnce
- ReadWriteOnce
size: 10Gi
# storageClass: gp2

Expand All @@ -119,4 +119,4 @@ securityGroups:

opentelemetry:
enabled: false
instrumentation: ""
instrumentation: ""
10 changes: 5 additions & 5 deletions deploy/kubernetes/charts/orders/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ postgresql:
password: ""

image:
repository: postgres
repository: public.ecr.aws/docker/library/postgres
pullPolicy: IfNotPresent
tag: "16.1"

Expand All @@ -115,7 +115,7 @@ postgresql:
annotations: {}
labels: {}
accessModes:
- ReadWriteOnce
- ReadWriteOnce
size: 10Gi
# storageClass: gp2

Expand All @@ -131,7 +131,7 @@ rabbitmq:
password: ""

image:
repository: "rabbitmq"
repository: "public.ecr.aws/docker/library/rabbitmq"
pullPolicy: IfNotPresent
tag: "3-management"

Expand All @@ -155,7 +155,7 @@ rabbitmq:
annotations: {}
labels: {}
accessModes:
- ReadWriteOnce
- ReadWriteOnce
size: 10Gi
# storageClass: gp2

Expand All @@ -166,4 +166,4 @@ securityGroups:

opentelemetry:
enabled: false
instrumentation: ""
instrumentation: ""
9 changes: 5 additions & 4 deletions deploy/terraform/lib/dependencies/catalog_rds.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ module "catalog_rds" {

name = "${var.environment_name}-catalog"
engine = "aurora-mysql"
engine_version = "5.7"
instance_class = "db.t3.small"
engine_version = "8.0"
instance_class = "db.t3.medium"
allow_major_version_upgrade = true

instances = {
one = {}
Expand All @@ -25,11 +26,11 @@ module "catalog_rds" {

create_db_parameter_group = true
db_parameter_group_name = "${var.environment_name}-catalog"
db_parameter_group_family = "aurora-mysql5.7"
db_parameter_group_family = "aurora-mysql8.0"

create_db_cluster_parameter_group = true
db_cluster_parameter_group_name = "${var.environment_name}-catalog"
db_cluster_parameter_group_family = "aurora-mysql5.7"
db_cluster_parameter_group_family = "aurora-mysql8.0"

tags = var.tags
}
Expand Down
4 changes: 2 additions & 2 deletions src/catalog/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '2'
version: "2"

services:
catalog:
Expand All @@ -24,7 +24,7 @@ services:
- "8081:8080"
# nosemgrep: yaml.docker-compose.security.writable-filesystem-service.writable-filesystem-service
catalog-db:
image: mysql:5.7
image: mysql:8.0
hostname: catalog-db
restart: always
security_opt:
Expand Down
2 changes: 1 addition & 1 deletion src/catalog/test/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func router() *gin.Engine {

func prepareContainer(ctx context.Context) (testcontainers.Container, string, error) {
req := testcontainers.ContainerRequest{
Image: "mysql:5.7",
Image: "mysql:8.0",
ExposedPorts: []string{"3306/tcp"},
WaitingFor: wait.ForLog("3306"),
Env: map[string]string{
Expand Down

0 comments on commit 8286041

Please sign in to comment.