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

[#849] Configure sanchogov.tools sub-domain for the analytics service #868

Conversation

placek
Copy link
Contributor

@placek placek commented Apr 25, 2024

Closes #849.

The changes made in this pull request aim to address the user story for configuring the sanchogov.tools sub-domain for the analytics service. By adding necessary environment variables, targets for building Docker images, and integrating the analytics-dashboard service into the Docker Compose setup, the infrastructure is now equipped to support the analytics functionality. Additionally, the inclusion of specific modules and adjustments ensures that the analytics-dashboard component is properly integrated and managed within the infrastructure setup. These modifications enhance security and enable the monitoring and deployment of the analytics service according to the project requirements. This pull request provides a holistic approach towards aligning the infrastructure with the objectives outlined in the user story.

@placek placek self-assigned this Apr 25, 2024
@placek placek linked an issue Apr 25, 2024 that may be closed by this pull request
@placek placek force-pushed the feat/849-configure-sanchogovtools-sub-domain-for-the-analytics-service branch from 5639cd3 to 61e77de Compare April 25, 2024 05:21
adgud and others added 4 commits April 25, 2024 09:35
This adds Terraform code that creats "participation" subdomains for each environments.
The exception is the beta environment, where DNS records are not handled with TF,
but need to be created manually.
Moved the Makefiles from various directories to the scripts directory
for better organization and consistency. Renamed the Makefiles
accordingly and updated the references within other files to use the new
paths in the scripts directory. This restructuring helps in streamlining
the build processes and eases maintenance tasks related to the make
files.
…for scripts and infrastructure to meet the requirements stated in the
terraform configuration

In this commit, changes have been made to the `flake.nix` file to
utilize a more recent version of nixpkgs for both scripts and
infrastructure. The modifications ensure that the scripts and
infrastructure align with the specified requirements in the terraform
configuration. Specifically, the nodePkgs import has been updated to
allow unfree packages, and the packages.scripts and packages.infra
sections have been adjusted to utilize the nodePkgs instead of
defaultPkgs. This adjustment guarantees that the scripts and
infrastructure components are in line with the necessary configurations,
enhancing compatibility and meeting the user story's demands.
A registry has been incorporated for the analytics-dashboard module
within the Terraform configuration. This modification introduces a new
module named "govtool-ecr-analytics-dashboard" sourced from
"./modules/ecr" with the repository name set to "analytics-dashboard."
By including this new module, the analytics-dashboard component is now
integrated into the infrastructure setup, aligning with the user story's
objective of configuring the sanchogov.tools sub-domain for the
analytics service.
@placek placek force-pushed the feat/849-configure-sanchogovtools-sub-domain-for-the-analytics-service branch 2 times, most recently from d46743f to 0ca0811 Compare April 25, 2024 10:20
@placek placek marked this pull request as ready for review April 25, 2024 10:33
Included a target in the Makefile to facilitate the creation of a Docker
image for the analytics-dashboard component. This addition enables the
generation and pushing of the analytics-dashboard Docker image as part
of the deployment process. By introducing this functionality, the build
process now encompasses the analytics-dashboard, supporting the user
story's aim of configuring the sanchogov.tools sub-domain for the
analytics service.
@placek placek force-pushed the feat/849-configure-sanchogovtools-sub-domain-for-the-analytics-service branch from 7e5f1a7 to 142d330 Compare April 25, 2024 11:12
placek and others added 7 commits April 25, 2024 13:32
…ation

Include essential environment variables in the deployment configuration
for beta, dev, staging, and test environments. New environment variables
such as `NEXT_PUBLIC_GA4_PROPERTY_ID`, `GA_CLIENT_EMAIL`,
`GA_PRIVATE_KEY`, `GOOGLE_APPLICATION_CREDENTIALS`,
`SENTRY_IGNORE_API_RESOLUTION_ERROR`, and `NEXT_PUBLIC_API_URL` have
been added to the workflow files, enabling the successful deployment and
integration of the analytics-dashboard submodule. By introducing these
environment variables, the deployment process is now equipped with
essential information required for analytics functionality, aligning
with the user story's goal of configuring the `sanchogov.tools`
sub-domain for the analytics service.
Include a new service, analytics-dashboard, in the Docker Compose
configuration file located at
scripts/govtool/config/templates/docker-compose.yml.tpl. This addition
introduces the analytics-dashboard service to the existing setup,
allowing the service to be deployed as part of the infrastructure. The
analytics-dashboard service is configured with necessary environment
variables such as NEXT_PUBLIC_GA4_PROPERTY_ID,
GOOGLE_APPLICATION_CREDENTIALS, GA_CLIENT_EMAIL, GA_PRIVATE_KEY,
SENTRY_IGNORE_API_RESOLUTION_ERROR, and NEXT_PUBLIC_API_URL to enable
proper functionality. The service's health is monitored through defined
health check parameters, ensuring its stability within the deployment
environment. By integrating the analytics-dashboard service into the
Docker Compose setup, the infrastructure aligns with the user story's
goal of configuring the sanchogov.tools sub-domain for the analytics
service.
In this commit, additional docker login commands were incorporated into
the target in the `common.mk` file located at `scripts/govtool`. These
new commands facilitate the authentication process for various
repository URLs, ensuring access to the necessary Docker images during
the build and deployment phases. With these additions, the script now
covers the login requirements for the `analytics-dashboard`, `backend`,
`frontend`, `metadata-validation`, and `status-service` repositories.
Introduce a secret configuration for the analytics-dashboard service
within the Docker Compose setup. This modification includes the addition
of the `google-credentials.json` secret to enhance the security and
integrity of sensitive information utilized by the service. By
incorporating the secret, the analytics-dashboard service gains access
to the specified Google credentials, ensuring secure interactions with
external services and APIs, as mandated by the user story's requirement
to configure the `sanchogov.tools` sub-domain for the analytics service.
This target checks if $CI env variable is set to true, which indicates that the code
is executed in a CI runner, and sets up SSH client config to enable reusing of open
SSH connections. This should resolve SSH connections issues observed during deployments
git-subtree-dir: govtool/analytics-dashboard
git-subtree-split: 9d116a9c785edde019a243cee950eb4e476c633f
@placek placek force-pushed the feat/849-configure-sanchogovtools-sub-domain-for-the-analytics-service branch from 142d330 to cc33beb Compare April 25, 2024 11:36
@placek placek merged commit 91d9eb0 into develop Apr 25, 2024
@placek placek deleted the feat/849-configure-sanchogovtools-sub-domain-for-the-analytics-service branch April 25, 2024 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configure sanchogov.tools sub-domain for the analytics service
2 participants