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

AP-4505: Test branch #5874

Closed
wants to merge 6 commits into from
Closed

AP-4505: Test branch #5874

wants to merge 6 commits into from

Conversation

jsugarman
Copy link
Contributor

What

Test fresh branch using redis chart on UAT

Relates to story
Relates to story

  • AP-4499: Configure unamespaced sidekiq plus drainer worker
  • AP-4499: Add test mail job
  • AP-4499: Add redis helm chart and configure for UAT use

Checklist

Before you ask people to review this PR:

  • Tests and rubocop should be passing: bundle exec rake
  • Github should not be reporting conflicts; you should have recently run git rebase main.
  • There should be no unnecessary whitespace changes. These make diffs harder to read and conflicts more likely.
  • The PR description should say what you changed and why, with a link to the JIRA story.
  • You should have looked at the diff against main and ensured that nothing unexpected is included in your changes.
  • You should have checked that the commit messages say why the change was made.

@jsugarman jsugarman force-pushed the ap-4505/test-branch branch 4 times, most recently from 6a7e851 to a983d15 Compare October 17, 2023 10:32
Change the apps sidekiq client to use unamespaced redis for
"new" jobs but add a "drainer" worker to process already
enqueued "namespaced" jobs.
This can be used to test whether the drainer is working

```ruby
\# Test "new" denamespaced sidekiq is being drained/processed
client = Sidekiq::Client.new
client.push('queue' => 'default', 'class' => TestMailJob , 'args' => ['[email protected]', 'Testing new denamespaced job processing'])
```

```ruby
\# Test "old" namespaced sidekiq is being drained/processed
redis_url = "rediss://:#{ENV.fetch('REDIS_PASSWORD', nil)}@#{ENV.fetch('REDIS_HOST', nil)}:6379"
redis_namespace = ENV.fetch("HOST", "laa-apply")
redis_connection = Sidekiq::RedisConnection.create(url: redis_url, namespace: redis_namespace)
client = Sidekiq::Client.new(redis_connection)
client.push('queue' => 'default', 'class' => TestMailJob , 'args' => ['[email protected]', 'Testing old namespaced job processing'])
```
- Add redis chart ^16
  This maps to 6.2.7 at time of writing, inline with 6.2.6 in production

- Add redis protocol env var with fallback of `rediss` - TLS
  Allows transaparent use of different protocol on UAT (`redis://`)
  as opposed to staging and production (`rediss://`).

  While enabling TLS for bitnami/redis is possible it requires
  generation and/or use of existing certificates. Plus since
  communication is within the cluster TLS is not required.

- Configure the redis chart
  Use standalone architecture (only a master, no replicas) and
  Specify cpu and memory limits. These should ensure minimal resource
  consumption for branches and limit the number of pods/containers
  we are using.
Use a different redis host name depending on whether the
release name contains the name of the chart, "redis".

TODO: if cloud-platform-tools image is update to helm 3.7+, currently 3.6+
we could use a `Subcharts` references in a helper as below instead.

```yaml
{{/*
Function to return the name for a UAT redis chart master node host
*/}}
{{- define "apply-for-legal-aid.redis-uat-host" -}}
  {{- $redis_fullName := (include "common.names.fullname" .Subcharts.redis) -}}
  {{- $redis_cluster_domain := "cluster.local" -}}
  {{- printf "%s-master.%s.svc.%s" $redis_fullName .Release.Namespace $redis_cluster_domain -}}
{{- end -}}
```
Decomplicate the `_envs` file and allows commenting
on reason for conditional logic.
@jsugarman jsugarman force-pushed the ap-4505/test-branch branch from a983d15 to 803135d Compare October 18, 2023 10:25
@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

@jsugarman jsugarman closed this Oct 19, 2023
@jsugarman jsugarman deleted the ap-4505/test-branch branch October 19, 2023 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant