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

Remove run ID and introduce deploy ID #93

Merged
merged 9 commits into from
Feb 22, 2024
Merged

Remove run ID and introduce deploy ID #93

merged 9 commits into from
Feb 22, 2024

Conversation

gmega
Copy link
Member

@gmega gmega commented Feb 2, 2024

This PR removes the notion of a run id and replaces it with a deploy id in continuous tests. Deploy ids can be set at deploy time only (duh), and will be picked up by the test runner from the deploy file on subsequent runs of the continuous test runner. As a consequence, the deploy id becomes a deployer parameter, and can no longer be overridden at the runner. For non-continuous tests, the deploy ID is created on-the-fly.

@gmega gmega marked this pull request as ready for review February 2, 2024 20:06
@veaceslavdoina
Copy link
Contributor

So, there no runid env var anymore?

  • will deployment id be generated automatically at deployment?
  • can we still set out own deployment id via env var?
  • what is the way to get same unique value through the run for
    • Prometheus - populated from Pod labels
    • Elasticsearch - populated from _STATUS.log

I did a test run via GitHub Actions and there we still assign runid label/env manually via template, but

  • I can't see deploymentid label - this is used by Prometheus
  • In 09-56-44Z_ContinuousTestRun_STATUS.log I see "runid":"20240206-095227"
  • Actual runid set by GitHub Actions was 20240206-095044 - I will remove that when we will switch to deployment id

@gmega
Copy link
Member Author

gmega commented Feb 8, 2024

So, there no runid env var anymore?

Correct, now there's only a deploy id, which you can set when you deploy a new network.

* will `deployment id` be generated automatically at deployment?

Yes, if nothing is set. You can still customize it with DEPLOYID when doing the deploy, but you can no longer set it when you fire the test runner, as that's the whole point: the test runner will just pick up the deploy id from the deploy file.

* can we still set out own `deployment id` via env var?

Yes (see above).

* what is the way to get same unique value through the run for
  
  * Prometheus - populated from Pod labels
  * Elasticsearch - populated from _STATUS.log

The runid in the Pod labels should already be correct, and match what's in the status.

I did a test run via GitHub Actions and there we still assign runid label/env manually via template, but

* I can't see `deploymentid` label - this is used by Prometheus

* In `09-56-44Z_ContinuousTestRun_STATUS.log` I see `"runid":"20240206-095227"`

Correct, I didn't change the external facing attribute names (except for the env var 😬) - sorry for not mentioning that sooner. They are still called runid both in the status log and the Prometheus labels, even though they are now technically deploy IDs and are no longer allowed to diverge.

* Actual `runid` set by GitHub Actions was `20240206-095044` - I will remove that when we will switch to `deployment id`

Yeah, for now what will happen is that if you don't set DEPLOYID then it will simply generate it automatically, using a very similar strategy to what you have in the github action.

@@ -26,7 +28,7 @@ public void ConcludeTest(string resultStatus, TimeSpan testDuration, Dictionary<
public void ConcludeTest(string resultStatus, string testDuration, Dictionary<string, string> data)
{
data.Add("timestamp", DateTime.UtcNow.ToString("o"));
data.Add("runid", NameUtils.GetRunId());
data.Add("runid", deployId);
Copy link
Contributor

Choose a reason for hiding this comment

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

key is still "runid". Should it be "deployid"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I was delaying changing the actual label to sync up with @veaceslavdoina, maybe now is the time.

@@ -76,7 +78,7 @@ public void OnContainersStopped(RunningContainers rc)
public void OnContainerRecipeCreated(ContainerRecipe recipe)
{
recipe.PodLabels.Add("tests-type", TestsType);
recipe.PodLabels.Add("runid", NameUtils.GetRunId());
recipe.PodLabels.Add("runid", deployId);
Copy link
Contributor

Choose a reason for hiding this comment

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

same here!

@@ -27,7 +29,7 @@ public void OnContainersStopped(RunningContainers rc)
public void OnContainerRecipeCreated(ContainerRecipe recipe)
{
recipe.PodLabels.Add("tests-type", testsTypeLabel);
recipe.PodLabels.Add("runid", NameUtils.GetRunId());
recipe.PodLabels.Add("runid", deployId);
Copy link
Contributor

Choose a reason for hiding this comment

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

one more!

@gmega gmega merged commit ec0f7a6 into master Feb 22, 2024
@gmega gmega deleted the feat/deploy-id branch February 22, 2024 13:41
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.

None yet

3 participants