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

Add support for environment variable #2626

Merged
merged 1 commit into from
Sep 12, 2024
Merged

Conversation

crazoes
Copy link

@crazoes crazoes commented Aug 2, 2024

This change will allow us to run some kselftests which requires to pass parameters

@nuclearcat nuclearcat added the staging-skip Don't test automatically on staging.kernelci.org label Aug 8, 2024
@nuclearcat
Copy link
Member

This patch wont work as env not defined in parameters. Also if it is missing, it is breaking template.
kernelci/kernelci-pipeline#750

@crazoes
Copy link
Author

crazoes commented Aug 8, 2024

@nuclearcat we already got the parameter support merged in the Linaro's test-definition here Linaro/test-definitions#511

Why will this not work?

@nuclearcat
Copy link
Member

nuclearcat commented Aug 8, 2024

2 problems:

  1. config/lava/kselftest/kselftest.jinja2 belongs to legacy system
  2. If parameter "env" is not defined in yaml file in params sections, it will corrupt yaml file generated by template. (and this is what happened in referenced issue)

@nfraprado
Copy link
Contributor

FWIW I had this as part of #2577 . Haven't had time to re-test get it merged yet. I'd be fine with adding staging-skip to my PR and letting you merge the ENV functionality through this PR first. Also Denys' comment about the case when ENV is undefined is also not handled in my PR, so that'd need fixing.

@JenySadadia
Copy link
Collaborator

Hello @crazoes
I think you need to define env inside params section of job definition.
For instance here https://github.com/kernelci/kernelci-pipeline/blob/main/config/pipeline.yaml#L890

@crazoes
Copy link
Author

crazoes commented Aug 13, 2024

@nuclearcat @JenySadadia I already created a PR for adding env into the pipeline.yaml file
kernelci/kernelci-pipeline#743

Does that look good? I'll change it to point to generic.jinja2 instead of kselftest.jinja2

@JenySadadia
Copy link
Collaborator

@nuclearcat @JenySadadia I already created a PR for adding env into the pipeline.yaml file kernelci/kernelci-pipeline#743

Does that look good? I'll change it to point to generic.jinja2 instead of kselftest.jinja2

Yes, after renaming the template, it should work.

@crazoes crazoes requested a review from a-wai August 14, 2024 08:59
@crazoes
Copy link
Author

crazoes commented Aug 14, 2024

@a-wai does this patch look good to you?
kernelci/kernelci-pipeline#743 depends on this one.

@@ -27,3 +27,4 @@
BOARD: {{ device_type }}
BRANCH: {{ tree }}
SKIP_INSTALL: True
ENV: '{{ env }}'
Copy link
Contributor

Choose a reason for hiding this comment

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

I would drop this change, as this template is only used for the legacy system and therefore not relevant for your use-case. Otherwise LGTM.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, I updated the commit

@pawiecz pawiecz removed the staging-skip Don't test automatically on staging.kernelci.org label Aug 21, 2024
config/runtime/tests/kselftest.jinja2 Outdated Show resolved Hide resolved
This change will allow us to run some kselftests which requires
to pass parameters

Signed-off-by: Shreeya Patel <[email protected]>
@a-wai
Copy link
Contributor

a-wai commented Aug 23, 2024

LGTM, but it seems something is still wrong: weird output in LAVA

@crazoes
Copy link
Author

crazoes commented Aug 26, 2024

@a-wai this usually happens when the kernel has not been updated. If the kernel doesn't have the patch to add support for new parameters then test will not work as expected.
Do you know if we are using latest kernel image from the KernelCI repo?

@nuclearcat
Copy link
Member

We are almost always using tip of tree images (latest).
We need to make sure this patches works on all kernels, including stable-rc trees.

@a-wai
Copy link
Contributor

a-wai commented Aug 27, 2024

This job was running on 6.11-rc4, so not exactly an old kernel... Are additional patches required?

@crazoes
Copy link
Author

crazoes commented Aug 27, 2024

@a-wai yes we need additional patch in the kernel in order to run the suspend and hibernation test with RTC.
Shuah is going to merge it in the current merge window but we didn't want to wait for it so @laura-nao had added the required patch to our linux repo https://github.com/kernelci/linux/tree/staging-mainline

Btw, do you know which branch do we use from the above? Because I don't see my patch added to the staging mainline branch.

https://lore.kernel.org/lkml/[email protected]/

@a-wai
Copy link
Contributor

a-wai commented Aug 27, 2024

Ah, then you need to add rules to this job so it only runs on the staging-mainline branch; the LAVA job I linked to ran on Linus' tree, so without your patches.

@crazoes
Copy link
Author

crazoes commented Sep 3, 2024

If everything looks good then can we merged this now @nuclearcat @a-wai ?

@laura-nao
Copy link
Contributor

@laura-nao had added the required patch to our linux repo https://github.com/kernelci/linux/tree/staging-mainline

@crazoes just for clarity, I didn't add the patch to staging-mainline but to the collabora-next tree. Fwiw you can run the test on the next tree now since the patch already landed there.

@nfraprado
Copy link
Contributor

If this is ready can it be merged? I'm waiting on it to resume working on #2577. Thanks.

@nuclearcat
Copy link
Member

I verified one of latest jobs, https://staging.kernelci.org:9000/viewer?node_id=66e2bc615785c698a0038303, can spot

      parameters:
        ENV: ''
        SKIPFILE: /dev/null
        SKIP_INSTALL: true
        TESTPROG_URL: https://kciapistagingstorage1.file.core.windows.net/staging/kbuild-gcc-12-x86-66e2b3ea5785c698a0037dda/kselftest.tar.gz?sv=2022-11-02&ss=f&srt=sco&sp=r&se=2024-10-17T19:19:12Z&st=2023-10-17T11:19:12Z&spr=https&sig=sLmFlvZHXRrZsSGubsDUIvTiv%2BtzgDq6vALfkrtWnv8%3D

So ENV variable seems present and properly formatted, even it is empty.
Merging, thanks.

@nuclearcat nuclearcat added this pull request to the merge queue Sep 12, 2024
Merged via the queue into kernelci:main with commit 0518f39 Sep 12, 2024
4 checks passed
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.

7 participants