Skip to content

Conversation

@bensze01
Copy link
Contributor

@bensze01 bensze01 commented Jul 23, 2025

This PR contains all the changes needed to get the new CI working with the main branch. Resolves #225.
(Currently it runs off of dev/dgreen-arm/openci-testing)

@bensze01 bensze01 added enhancement New feature or request size-s Estimated task size: small (~2d) priority-medium labels Jul 23, 2025
@bensze01 bensze01 force-pushed the dev/bensze01/openci-testing branch 7 times, most recently from 81d82b5 to e1e1777 Compare August 20, 2025 07:27
@bensze01 bensze01 force-pushed the dev/bensze01/openci-testing branch from e1e1777 to 8d1aab7 Compare September 11, 2025 14:43
@bensze01 bensze01 force-pushed the dev/bensze01/openci-testing branch from 8d1aab7 to aacb082 Compare September 16, 2025 16:25
dgreen-arm and others added 13 commits October 21, 2025 19:49
Signed-off-by: Bence Szépkúti <[email protected]>
ECRs are not used on the current Open CI, nor is the value of docker_ecr
used in the Open CI codepaths.

Signed-off-by: Bence Szépkúti <[email protected]>
Use the full URL instead of the shortened form that docker also permits.

Signed-off-by: Bence Szépkúti <[email protected]>
This way we don't need to update the script if we change which CI runs
the merge queues.

Signed-off-by: Bence Szépkúti <[email protected]>
The image name on the new CI corresponds to the public Dockerhub urls.

Signed-off-by: Bence Szépkúti <[email protected]>
Define a new method, common.mbedtls_node() to make the transition
easier. This lets us keep using the same node labels accross the CIs in
most of the codebase.

Signed-off-by: Bence Szépkúti <[email protected]>
Signed-off-by: Bence Szépkúti <[email protected]>
Log the reason docker manifest inspect failed to help debugging.
It may fail in an unexpected way, eg. if dockerhub is rate limiting us.

Signed-off-by: Bence Szépkúti <[email protected]>
Signed-off-by: Bence Szépkúti <[email protected]>
Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm left a comment

Choose a reason for hiding this comment

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

Mostly looks good to me on visual inspection. I know this is already running live on the new CI. I still want:

  • Better documentation.
  • Some validation that this doesn't break the old CI while we're transitioning.

@Field final boolean is_open_ci_env = env.JENKINS_URL ==~ /\S+(mbedtls\.trustedfirmware\.org)\S+/

/* Indicates if CI is running on the new CI (hosted on https://ci.trustedfirmware.org/) */
@Field final boolean is_new_ci_env = !is_open_ci_env && (env.JENKINS_URL ==~ /\S+(trustedfirmware)\S+/)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please give the “new CI” a distinctive name. I don't want to change this file to start distinguishing between the “old new CI” and the “new new CI” in a few years.

/* Indicates if CI is running on Open CI (hosted on https://ci.trustedfirmware.org/) */
@Field is_open_ci_env = env.JENKINS_URL ==~ /\S+(trustedfirmware)\S+/
/* Indicates if CI is running on Open CI (hosted on https://mbedtls.trustedfirmware.org/) */
@Field final boolean is_open_ci_env = env.JENKINS_URL ==~ /\S+(mbedtls\.trustedfirmware\.org)\S+/
Copy link
Contributor

Choose a reason for hiding this comment

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

Non-blocker: I'd prefer something a little more structured and comprehensible, like

enum CI_Instance {
    CI_Other,           // Unexpected, may happen when trying out new infrastructure
    CI_ArmInternal,     // Arm internal CI (since 2017)
    CI_ArmOpenCI,       // Arm-maintained OpenCI (since 2025)
    CI_LinaroOpenCI,    // Linaro-maintained OpenCI (since 2022)
}

def CI_Instance ci_from_url(String url_string) {
    String host = url_string.toURL().getHost()
    if (host ==~ /\.arm\.com$/) {
        return CI_ArmInternal
    } else if (host ==~ /mbedtls.*\.trustedfirmware\.org$/) {
        return CI_LinaroOpenCI
    } else if (host ==~ /\.trustedfirmware\.org$/) {
        return CI_ArmOpenCI
    } else {
        return CI_Other
    }
}

@Field which_ci = ci_from_url(env.JENKINS_URL)


```
node (label) {
common.mbedtls_node (label) {
Copy link
Contributor

Choose a reason for hiding this comment

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

More things need updating in the developer guide.

- TF OpenCI -> TF OpenCI (legacy)
- New CI (testing) -> TF OpenCI

Signed-off-by: Minos Galanakis <[email protected]>
Signed-off-by: Minos Galanakis <[email protected]>
@minosgalanakis minosgalanakis force-pushed the dev/bensze01/openci-testing branch from 552c956 to 87703e9 Compare November 5, 2025 16:00
@minosgalanakis
Copy link
Contributor

minosgalanakis commented Nov 5, 2025

As of 87703e9

Had to remove the code to implement this change. It was throwing me into a rabit hole of scripts permissions missalignment between CI's.

# When using toURL
Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods toURL java.lang.String. Administrators can decide whether to approve or reject this signature.

# When using the Java java.net.URL
Scripts not permitted to use method java.net.URL getHost. Administrators can decide whether to approve or reject this signature.

Testing jobs

Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm left a comment

Choose a reason for hiding this comment

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

Looks mostly good to me on code inspection. I can't think of anything else that would need updating in the guide.

Once the code changes are complete, please link the test jobs that you've run in the PR description.


#### Jenkins jobs

On OpenCI, the jobs are defined by YAML configuration files managed in a Gerrit instance: [browse code](https://review.trustedfirmware.org/plugins/gitiles/ci/mbedtls/mbed-tls-job-configs), [contributor setup](https://review.trustedfirmware.org/Documentation/user-upload.html), [reviews](https://review.trustedfirmware.org/q/project:ci/mbedtls/mbed-tls-job-configs+status:open). On the internal CI, the jobs and job configurations can be edited directly through the web interface.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can someone confirm whether the new OpenCI uses the same repository as the old OpenCI for the configuration?

I see a branch called openci-migration in that repository, is it relevant? Does it need to be merged as part of the CI transition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The "new" CI indeed uses the openci-migration branch for now (since we need slightly different configuration for the two CIs at the moment.)

It can be migrated back to the master branch at our leisure once the "old" OpenCI is shut down.

@minosgalanakis
Copy link
Contributor

Head at 68c77aa

Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm left a comment

Choose a reason for hiding this comment

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

Looks good to me at 68c77aa in terms of reading the code.

With respect to validation, given the changes here, I would like to see tests that exercise the following features: docker instantiation (so basically anything), actual use of arm-compilers because it gets special treatment (so e.g. a PR job or a release job), actual use of the various node labels, GitHub reporting, and a Dockerfile rebuild. So I propose, on all thre CIs:

@mpg
Copy link
Contributor

mpg commented Nov 17, 2025

Thanks for fixing the link. However, I haven't done a full review, nor did I intend do. Are you expecting a full review from me, or just a check that my drive-by comment has been addressed?

@minosgalanakis minosgalanakis force-pushed the dev/bensze01/openci-testing branch from 30738c9 to e5add1f Compare November 17, 2025 10:15
@minosgalanakis
Copy link
Contributor

minosgalanakis commented Nov 17, 2025

Testing at e5add1f

Internal CI

New CI Release Job

Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request needs: review priority-high size-s Estimated task size: small (~2d)

Projects

Development

Successfully merging this pull request may close these issues.

Adapt Groovy code to the new CI

6 participants