You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need variables that are stored in the AWS parameter store.
Getting these variables can take a lot of time up to the point where some tests are timing out.
The solution is to declare these variables as environment variables <-- avoid costly AWS Parameter store queries.
In PR #16 we have created a bash script aws.env. That script's ONLY objective is to optimize our code --> avoid querying the AWS parameter store again and again.
Since the Environment variable (ex: BUGZILLA_DB_USER) has been set, there should be NO NEED for a call to the AWS parameter store.
The INFO on the Travis CI build should be something like "BUGZILLA_DB_USER overridden by local env: xxxx"
Actual result:
The message in the travis build is INFO[0002] BUGZILLA_DB_USER is unset as an environment variable. The value is **bugzilla** in AWS Parameter store
This tells us that the main.go script had to query AWS to get that variable <-- NOT GOOD
In the current PR #16 to facilitate and speed up debugging, we have temporarily imported some of the code that will eventually be part of the uneet/env repo.
The key functions we need and that are supposed to be in the uneet/env repo are:
Where are you intending to optimise these parameter store lookups?
when the function is run?
on CI?
on go test? Can you show a build where this is slow?
When the function is run probably makes the most sense and you can set that with up env. But then you would need to build this into the deployment process.
Overview:
We need variables that are stored in the AWS parameter store.
Getting these variables can take a lot of time up to the point where some tests are timing out.
The solution is to declare these variables as environment variables <-- avoid costly AWS Parameter store queries.
The
aws.env
script:In PR #16 we have created a bash script
aws.env
. That script's ONLY objective is to optimize our code --> avoid querying the AWS parameter store again and again.See how it work in the Travis CI build of the unit repo (WIP)
You can see that the environment variables are correctly set in the OS:
The problem:
We are using the go module/package
os
and the function os.LookupEnv in our main.go file (see an example here).Expected result:
Since the Environment variable (ex:
BUGZILLA_DB_USER
) has been set, there should be NO NEED for a call to the AWS parameter store.The INFO on the Travis CI build should be something like
"BUGZILLA_DB_USER overridden by local env: xxxx"
Actual result:
The message in the travis build is
INFO[0002] BUGZILLA_DB_USER is unset as an environment variable. The value is **bugzilla** in AWS Parameter store
This tells us that the main.go script had to query AWS to get that variable <-- NOT GOOD
See screenshot from the Travis CI build
Context:
In the current PR #16 to facilitate and speed up debugging, we have temporarily imported some of the code that will eventually be part of the uneet/env repo.
The key functions we need and that are supposed to be in the uneet/env repo are:
BugzillaDSN
New
<-- this has been renamed toNewConfig
in the PR Merge Une-T INS improvements - remove hardcoded values that should be in variables #16 to avoid conflicts.The text was updated successfully, but these errors were encountered: