Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2089 - Upgrade node version on all environments #2448

Merged
merged 2 commits into from
Oct 23, 2023

Conversation

andrepestana-aot
Copy link
Collaborator

@andrepestana-aot andrepestana-aot commented Oct 20, 2023

Upgrade local

Please upgrade your local NodeJS version from https://nodejs.org/en/download and check if you are really using the new version:

$ node -v

Current LTS

Just for reference, you can check nodejs' schedule for maintenance.

New features

You can check out the new features here.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions
Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 18.18% ( 2341 / 12877 )
Methods: 9.28% ( 151 / 1628 )
Lines: 20.7% ( 2016 / 9740 )
Branches: 11.53% ( 174 / 1509 )

@github-actions
Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 75.72% ( 555 / 733 )
Methods: 69.32% ( 61 / 88 )
Lines: 77.64% ( 486 / 626 )
Branches: 42.11% ( 8 / 19 )

@github-actions
Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 52.62% ( 341 / 648 )
Methods: 50% ( 40 / 80 )
Lines: 56.85% ( 282 / 496 )
Branches: 26.39% ( 19 / 72 )

@github-actions
Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 55.6% ( 4088 / 7352 )
Methods: 52.88% ( 505 / 955 )
Lines: 60.31% ( 3313 / 5493 )
Branches: 29.87% ( 270 / 904 )

@@ -231,31 +231,31 @@ build-db-migrations:
test -n "$(BUILD_REF)"
test -n "$(DB_MIGRATIONS_BUILD_REF)"
@echo "+\n++ BUILDING DB migrations with tag: $(BUILD_REF)\n+"
@oc -n $(BUILD_NAMESPACE) process -f $(BUILD_TEMPLATE_PATH) -p TAG=$(BUILD_REF) -p SOURCE_REPOSITORY_REF=$(BUILD_REF) -p BASE_IMAGE_NAME="nodejs-16" -p BASE_IMAGE_TAG="1" -p BASE_IMAGE_REPO="artifacts.developer.gov.bc.ca/redhat-access-docker-remote/ubi8/" -p SOURCE_CONTEXT_DIR=$(SOURCE_CONTEXT_DIR)backend -p DOCKER_FILE_PATH=apps/db-migrations/Dockerfile -p NAME=$(DB_MIGRATIONS_BUILD_REF) | oc -n $(BUILD_NAMESPACE) apply -f -
@oc -n $(BUILD_NAMESPACE) process -f $(BUILD_TEMPLATE_PATH) -p TAG=$(BUILD_REF) -p SOURCE_REPOSITORY_REF=$(BUILD_REF) -p BASE_IMAGE_NAME="nodejs-18" -p BASE_IMAGE_TAG="1-71.1697652955" -p BASE_IMAGE_REPO="artifacts.developer.gov.bc.ca/redhat-access-docker-remote/ubi8/" -p SOURCE_CONTEXT_DIR=$(SOURCE_CONTEXT_DIR)backend -p DOCKER_FILE_PATH=apps/db-migrations/Dockerfile -p NAME=$(DB_MIGRATIONS_BUILD_REF) | oc -n $(BUILD_NAMESPACE) apply -f -
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we use tag 1 like before? they point to same version

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tag is recommended by RedHat:
image

Version 1-15 (from a year ago):
image
Compared to 1-71.1697652955 (latest):
image

1-71 tag has 12 important security adivisories:
image

Copy link
Collaborator

@dheepak-aot dheepak-aot Oct 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't 1-71.1697652955 | latest | 1 the same? I was trying to say we can use 1 instead of the long version 1-71.1697652955 and also I believe 1 must hold latest stable version of the node-18 image.

Correct me if wrong.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Holding the latest stable version would be good but that must happen manually and it must be under our control, that is the same reason that we do not use latest all around 😉

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, after our talk I got what you mean. Well, ,we can use tag 1 and that would get the latest version for major version 1.
Before we were using version 1-5 and that one doesn't point to any latest version.
@andrewsignori-aot @guru-aot @ann-aot @cditcher What do you guys suggest? Use 1 to always get the latest version or have a fixed tagged version?

@oc -n $(BUILD_NAMESPACE) start-build bc/$(DB_MIGRATIONS_BUILD_REF) --wait

build-api:
test -n "$(BUILD_NAMESPACE)"
test -n "$(BUILD_REF)"
test -n "$(API_BUILD_REF)"
@echo "+\n++ BUILDING API with tag: $(BUILD_REF)\n+"
@oc -n $(BUILD_NAMESPACE) process -f $(BUILD_TEMPLATE_PATH) -p TAG=$(BUILD_REF) -p SOURCE_REPOSITORY_REF=$(BUILD_REF) -p BASE_IMAGE_NAME="nodejs-16" -p BASE_IMAGE_TAG="1" -p BASE_IMAGE_REPO="artifacts.developer.gov.bc.ca/redhat-access-docker-remote/ubi8/" -p SOURCE_CONTEXT_DIR=$(SOURCE_CONTEXT_DIR)backend -p DOCKER_FILE_PATH=apps/api/Dockerfile -p NAME=$(API_BUILD_REF) | oc -n $(BUILD_NAMESPACE) apply -f -
@oc -n $(BUILD_NAMESPACE) process -f $(BUILD_TEMPLATE_PATH) -p TAG=$(BUILD_REF) -p SOURCE_REPOSITORY_REF=$(BUILD_REF) -p BASE_IMAGE_NAME="nodejs-18" -p BASE_IMAGE_TAG="1-71.1697652955" -p BASE_IMAGE_REPO="artifacts.developer.gov.bc.ca/redhat-access-docker-remote/ubi8/" -p SOURCE_CONTEXT_DIR=$(SOURCE_CONTEXT_DIR)backend -p DOCKER_FILE_PATH=apps/api/Dockerfile -p NAME=$(API_BUILD_REF) | oc -n $(BUILD_NAMESPACE) apply -f -
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oc -n $(BUILD_NAMESPACE) start-build bc/$(API_BUILD_REF) --wait

build-workers:
test -n "$(BUILD_NAMESPACE)"
test -n "$(BUILD_REF)"
test -n "$(WORKERS_BUILD_REF)"
@echo "+\n++ BUILDING WORKERS with tag: $(BUILD_REF)\n+"
@oc -n $(BUILD_NAMESPACE) process -f $(BUILD_TEMPLATE_PATH) -p TAG=$(BUILD_REF) -p SOURCE_REPOSITORY_REF=$(BUILD_REF) -p BASE_IMAGE_NAME="nodejs-16" -p BASE_IMAGE_TAG="1" -p BASE_IMAGE_REPO="artifacts.developer.gov.bc.ca/redhat-access-docker-remote/ubi8/" -p SOURCE_CONTEXT_DIR=$(SOURCE_CONTEXT_DIR)backend -p DOCKER_FILE_PATH=apps/workers/Dockerfile -p NAME=$(WORKERS_BUILD_REF) | oc -n $(BUILD_NAMESPACE) apply -f -
@oc -n $(BUILD_NAMESPACE) process -f $(BUILD_TEMPLATE_PATH) -p TAG=$(BUILD_REF) -p SOURCE_REPOSITORY_REF=$(BUILD_REF) -p BASE_IMAGE_NAME="nodejs-18" -p BASE_IMAGE_TAG="1-71.1697652955" -p BASE_IMAGE_REPO="artifacts.developer.gov.bc.ca/redhat-access-docker-remote/ubi8/" -p SOURCE_CONTEXT_DIR=$(SOURCE_CONTEXT_DIR)backend -p DOCKER_FILE_PATH=apps/workers/Dockerfile -p NAME=$(WORKERS_BUILD_REF) | oc -n $(BUILD_NAMESPACE) apply -f -
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1,5 +1,5 @@
# Base Image
FROM artifacts.developer.gov.bc.ca/redhat-access-docker-remote/ubi8/nodejs-16:1-5
FROM artifacts.developer.gov.bc.ca/redhat-access-docker-remote/ubi8/nodejs-18:1-71.1697652955
Copy link
Collaborator

@dheepak-aot dheepak-aot Oct 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1,5 +1,5 @@
# "builder" stage, based on Node.js, to build and compile the frontend.
FROM node:16.17.0-alpine3.16 AS builder
FROM node:18.17.1-alpine3.18 AS builder
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question to devs. Shouldn't we change the local docker for web to nginx?

@andrewsignori-aot @ann-aot @guru-aot @cditcher ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nginx:122 doesn't have npm:
image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im good.

#2448 (comment)

@dheepak-aot
Copy link
Collaborator

Nice work @andrepestana-aot 👍Added some comments.

@@ -231,31 +231,31 @@ build-db-migrations:
test -n "$(BUILD_REF)"
test -n "$(DB_MIGRATIONS_BUILD_REF)"
@echo "+\n++ BUILDING DB migrations with tag: $(BUILD_REF)\n+"
@oc -n $(BUILD_NAMESPACE) process -f $(BUILD_TEMPLATE_PATH) -p TAG=$(BUILD_REF) -p SOURCE_REPOSITORY_REF=$(BUILD_REF) -p BASE_IMAGE_NAME="nodejs-16" -p BASE_IMAGE_TAG="1" -p BASE_IMAGE_REPO="artifacts.developer.gov.bc.ca/redhat-access-docker-remote/ubi8/" -p SOURCE_CONTEXT_DIR=$(SOURCE_CONTEXT_DIR)backend -p DOCKER_FILE_PATH=apps/db-migrations/Dockerfile -p NAME=$(DB_MIGRATIONS_BUILD_REF) | oc -n $(BUILD_NAMESPACE) apply -f -
@oc -n $(BUILD_NAMESPACE) process -f $(BUILD_TEMPLATE_PATH) -p TAG=$(BUILD_REF) -p SOURCE_REPOSITORY_REF=$(BUILD_REF) -p BASE_IMAGE_NAME="nodejs-18" -p BASE_IMAGE_TAG="1-71.1697652955" -p BASE_IMAGE_REPO="artifacts.developer.gov.bc.ca/redhat-access-docker-remote/ubi8/" -p SOURCE_CONTEXT_DIR=$(SOURCE_CONTEXT_DIR)backend -p DOCKER_FILE_PATH=apps/db-migrations/Dockerfile -p NAME=$(DB_MIGRATIONS_BUILD_REF) | oc -n $(BUILD_NAMESPACE) apply -f -
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a ticket to check if we can remove the BASE_IMAGE_NAME and BASE_IMAGE_TAG from the make file? The idea would be to stop updating the image version in two places. If there is a benefit in the way as it is right now, please share 😉
@guru-aot @dheepak-aot @ann-aot FYI

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, as I was having a look on it, we use the BASE_IMAGE_NAME and BASE_IMAGE_TAG as metadata while building and for tag name. We can do a deep analysis and can remove it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guru-aot can you please post here for history when those metadas are displayed in OpenShift?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, looks good 👍

Copy link
Collaborator

@guru-aot guru-aot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice work @andrepestana-aot

Copy link
Contributor

@ann-aot ann-aot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @andrepestana-aot 👍

Copy link
Collaborator

@dheepak-aot dheepak-aot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@andrepestana-aot andrepestana-aot merged commit 5da7fc9 into main Oct 23, 2023
@andrepestana-aot andrepestana-aot deleted the 2089_upgrade_node_version branch October 23, 2023 23:56
@andrepestana-aot andrepestana-aot temporarily deployed to DEV October 24, 2023 00:10 — with GitHub Actions Inactive
@andrepestana-aot andrepestana-aot temporarily deployed to DEV October 24, 2023 00:11 — with GitHub Actions Inactive
@andrepestana-aot andrepestana-aot temporarily deployed to DEV October 24, 2023 00:11 — with GitHub Actions Inactive
@andrepestana-aot andrepestana-aot temporarily deployed to DEV October 24, 2023 00:11 — with GitHub Actions Inactive
@andrepestana-aot andrepestana-aot temporarily deployed to DEV October 24, 2023 00:11 — with GitHub Actions Inactive
@andrepestana-aot andrepestana-aot temporarily deployed to DEV October 24, 2023 00:14 — with GitHub Actions Inactive
@andrepestana-aot andrepestana-aot temporarily deployed to DEV October 24, 2023 00:14 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants