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

Rename e2e job names to ci-commitsha-uuid for consistency #246

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shivakunv
Copy link
Contributor

No description provided.

@shivakunv shivakunv self-assigned this Dec 19, 2024
@shivakunv shivakunv changed the title Rename e2e job names to ci- for consistency Rename e2e job names to ci-commitsha-uuid for consistency Dec 20, 2024
// uid is unique for each run
uid := GenerateUID()

cfg.Name = fmt.Sprintf("ci%s-%s-%s", attempt, sha, uid)
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if this change is desirable. Won't the names now become a lot longer?

Copy link
Contributor Author

@shivakunv shivakunv Dec 31, 2024

Choose a reason for hiding this comment

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

@tariq1890

old code:- opts.cfg.Name = opts.cfg.Name + "-" + common.GenerateUID()

changed to :-
common.SetCfgName(&opts.cfg)

No, it will not be longer, it will align with our e2e tests for the lib/app (e.g., gpu-operator, gpu-driver-container, etc.), which follow the naming format ci-commitid-uuid.

Currently, holodeck e2e tests use names derived from the yaml file's given name plus a UUID (e.g., holodeck-uuid).

As a result, the cleanup script, which only works for instances named in the format ci-commitid-uuid, will not clean up these instances.

This change will ensure that any instances not properly cleaned up will now be handled correctly.

Copy link
Contributor

Choose a reason for hiding this comment

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

As a result, the cleanup script, which only works for instances named in the format ci-commitid-uuid, will not clean up these instances.

If the cleanup script looks for VPCs/instances with the holodeck and cicd tags, wouldn't that suffice? Do you really need a particular name format?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

with
--filters "Name=tag:Project,Values=holodeck" "Name=tag:Environment,Values=cicd" in
#244

we dont need this PR . I'll close this PR after verification (deletion of resources )

Copy link
Collaborator

Choose a reason for hiding this comment

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

have you checked with the AWS API if it allows such long string names?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it allows
it will not be longer, it will align with our e2e tests for the lib/app (e.g., gpu-operator, gpu-driver-container, etc.), which follow the naming format ci-commitid-uuid.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pushed suggested code

@@ -28,3 +34,16 @@ func GenerateUID() string {

return string(b)
}

func SetCfgName(cfg *v1alpha1.Environment) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Two things

  1. common isn't the right package for this method. This method can be moved back to the same package where it is invoked and be made private

  2. The method should just return a name instead of taking the Environment object pointer as an argument .

cfg.Name := getName()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This PR is unnecessary as PR :
#244
will clean up AWS resources in the CICD environment with the specified holodeck project name.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think, unregardless of #244 I think having a nice standardized way of naming our instances is worth the effort. Agree with @tariq1890

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pushed suggested code

@ArangoGutierrez
Copy link
Collaborator

@shivakunv please rebase

@ArangoGutierrez
Copy link
Collaborator

@tariq1890 please take another look

@@ -28,3 +34,16 @@ func GenerateUID() string {

return string(b)
}

func SetCfgName(cfg *v1alpha1.Environment) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think, unregardless of #244 I think having a nice standardized way of naming our instances is worth the effort. Agree with @tariq1890

// uid is unique for each run
uid := GenerateUID()

cfg.Name = fmt.Sprintf("ci%s-%s-%s", attempt, sha, uid)
Copy link
Collaborator

Choose a reason for hiding this comment

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

have you checked with the AWS API if it allows such long string names?

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.

3 participants