scylla-cluster-tests icon indicating copy to clipboard operation
scylla-cluster-tests copied to clipboard

sct runs through SCT runners are hiding user and could also be created of a different region than the test

Open eliransin opened this issue 1 year ago • 5 comments

Prerequisites

  • [x] Are you rebased to master ?
  • [x] Is it reproducible ?
  • [x] Did you perform a cursory search if this issue isn't opened ?

Versions

  • SCT: master
  • scylla: master

Description

When running a command using hydra, there are two inconsistencies related to the relation between the runner and the instances produced by the tests ran on this runner. In the order of importance (IMHO):

  1. The command ran on the runner doesn't "inherit" the correct RunByUser and as a result any instances that are created on tests that are ran using a runner will have some generic RunByUser label
  2. The default hydra region doesn't correlate to the region the test will eventually run on, I think this should be validated somehow, this is specifically important when running tests, I am not sure about the other commands.

Steps to Reproduce

  1. Just run a test using an external runner and observer the RunByUser labels attached to the instances.

Expected behavior: I expect the RunByUser label to be the same for local and remote runs.

The reason I think this is a bug because the whole purpose of this label is to be able to locate instances ran by a specific user, it doesn't mean if directly or indirectly.

eliransin avatar Jun 14 '23 09:06 eliransin

@eliransin , you mean, you are running a test on an existing SCT Runner? or creating a new one while running the test? can you share the command you are using for it?

fgelcer avatar Jun 14 '23 09:06 fgelcer

Just to point out, this is only relevant when running locally.

In Jenkins they are started on the correct region as the test, and the user is taken from Jenkins.

fruch avatar Jun 14 '23 09:06 fruch

1 is quite easily solvable, we need to add a environment variable that would override the RunByUser, and hydra should set it when running ontop of a runner (if a user is sshing into the running and running on his own there, we can't know that, and it won't solve it)

2 the user would find out at the end about it, local addresses won't work for him. one might add a check, but not sure if we'll want to fail the test cause of that, and we'll need to make this check work on all backends.

fruch avatar Jun 14 '23 09:06 fruch

In Jenkins they are started on the correct region as the test, and the user is taken from Jenkins.

I think this is not entirely true, the sct uses (at least from what I can understan) is always sctuser.

eliransin avatar Jun 27 '23 08:06 eliransin

In Jenkins they are started on the correct region as the test, and the user is taken from Jenkins.

I think this is not entirely true, the sct uses (at least from what I can understan) is always sctuser.

We are using it on a daily basis, we would have noticed if resources are marked correctly like this.

I do agree that using a runner manually might not propograte the correct user.

fruch avatar Jun 27 '23 12:06 fruch