Skip to content

INSTA-37986: Add fedramp-pipeline.yaml to handle manual build & publish for fedramp cases#273

Open
FredrikAtIBM wants to merge 10 commits intomainfrom
INSTA-37986
Open

INSTA-37986: Add fedramp-pipeline.yaml to handle manual build & publish for fedramp cases#273
FredrikAtIBM wants to merge 10 commits intomainfrom
INSTA-37986

Conversation

@FredrikAtIBM
Copy link
Contributor

@FredrikAtIBM FredrikAtIBM commented Jun 16, 2025

Why

Needed to have a explicitly a version for fedramp-cases

What

Add fedramp-pipeline.yaml to handle manual build & publish for fedramp-cases.

References

@FredrikAtIBM FredrikAtIBM force-pushed the INSTA-37986 branch 4 times, most recently from 14982ff to 6f88cbd Compare June 23, 2025 08:07
@FredrikAtIBM FredrikAtIBM changed the title WIP INSTA-37986: Add fedramp-pipeline.yaml to handle manual build & publish for fedramp cases Jun 23, 2025
@FredrikAtIBM FredrikAtIBM marked this pull request as ready for review June 23, 2025 08:11
@FredrikAtIBM FredrikAtIBM requested a review from a team as a code owner June 23, 2025 08:11
type: dummy
config:
vars: &prerelease-container-registry
repository: delivery.instana.io/int-docker-agent-fedramp-prerelease-local/instana-agent-operator/fedramp-v1.0.0/instana-agent-operator
Copy link
Contributor

Choose a reason for hiding this comment

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

We can't hard code v1.0.0 here as versions will change in subsequent releases, we need instead to use the bucket version instead, like here: https://github.ibm.com/instana/autotrace-mutating-webhook/pull/560/files#diff-6f63be971f649e60f9e0bf2ff76948e553f4616d50da84311800a89f5d77014bR127-R135. Then, since image_registry resource doesn't let us use variables, pushes to artifactory would need to be manual. The webhook pipeline has an example how to do this.

type: dummy
config:
vars:
repository: delivery.instana.io/int-docker-agent-fedramp-release-local/instana-agent-operator/fedramp-v1.0.0/instana-agent-operator
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 as above

type: dummy
config:
vars:
repository: https://delivery.instana.io/artifactory/int-generic-agent-fedramp-release-local/instana-agent-operator/fedramp-v1.0.0/instana-agent-operator
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 as above

Comment on lines +144 to +165
- put: instana-agent-operator-fedramp-image-amd64
params:
image: image-amd64/image.tar
additional_tags: image-tags/amd64
- put: instana-agent-operator-fedramp-image-arm64
params:
image: image-arm64/image.tar
additional_tags: image-tags/arm64
- put: instana-agent-operator-fedramp-image-ppc64le
params:
image: image-ppc64le/image.tar
additional_tags: image-tags/ppc64le
- put: instana-agent-operator-fedramp-image-s390x
params:
image: image-s390x/image.tar
additional_tags: image-tags/s390x
Copy link
Contributor

Choose a reason for hiding this comment

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

Since fedramp version will be parametrized, we won't be able to use put with image_registry resource. Instead, you can use a similar script as we have for the webhook: ci/fedramp/deploy-image.yml

…sh for fedramp cases

Signed-off-by: Fredrik Gundersen <fredrik.gundersen@ibm.com>
Signed-off-by: Fredrik Gundersen <fredrik.gundersen@ibm.com>
@instana-agent-build
Copy link
Collaborator

instana-agent-build commented Jul 23, 2025

Checks Summary

Last run: 2025-07-23T15:20:23.401Z

Code Risk Analyzer vulnerability scan found 2 vulnerabilities:

Severity Identifier Package Details Fix
🔺High CVE-2025-22868 golang.org/x/oauth2
golang.org/x/oauth2 Improper Validation of Syntactic Correctness of Input vulnerabilityGHSA-6v2p-p543-phr9

0.27.0
◻Unknown CVE-2025-22868 golang.org/x/oauth2
Unexpected memory consumption during token parsing in golang.org/x/oauth2GO-2025-3488

0.27.0

…ployments

Signed-off-by: Fredrik Gundersen <fredrik.gundersen@ibm.com>
Copy link
Contributor

@cvrkota cvrkota left a comment

Choose a reason for hiding this comment

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

Looking at the artifactory, we don't push the images with the version tags, but just sha's and latest. We want to stay consistent with the old approach, where we don't just promote images with the same sha, but we push them with the real version in the release repository

FredrikAtIBM and others added 3 commits July 25, 2025 13:34
Co-authored-by: Milica Cvrkota <43457560+cvrkota@users.noreply.github.com>
Signed-off-by: Fredrik Gundersen <fredrik.gundersen@ibm.com>
echo "${PRERELEASE_CONTAINER_REPO_URL}" > variables/prerelease-container-repo-url
echo "${RELEASE_CONTAINER_REPO_URL}" > variables/release-container-repo-url
echo "${RELEASE_GENERIC_REPO}" > variables/release-generic-repo-url
echo "fedramp-release-v${FEDRAMP_VERSION}" > variables/release-branch
Copy link
Contributor

Choose a reason for hiding this comment

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

The branch should actually come from fedramp-version-default instead of the bucket as the branch won't change for every e.g. patch release. The branch changes only once every 6 months (for each new minor release)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't understand this. The source of truth in what version we build is the bucket version like in the PRs that were provided to me. The default value is the initial value. Did I misunderstand something about this from previous ones?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, but the release branch won't change every time the fedramp branch changes. The branch will get changes only for new minor releases, but we will keep using fedramp-release-v1.0.0 even when bumping patch releases. Probably the branch name should've been fedramp-release-v1.0.x, but this decision was done outside of our team. So we need here two inputs:

  • fedramp-version resource that should be used for artifactory paths
  • ((local-variables:fedramp-version-default)) which should be used for the branch resource

file: variables/release-branch
reveal: true
# Copy the source code as now we know which version to release with the right branch
- task: clone-source-code
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the clone manual? You can just define a resource with type: git with the branch name, and then to use get for fetching the resource

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 clone is manual as it seemed that manipulating a git resource is not possible if I'm not mistaken. Dynamic branching from the bucket will pull source as get to the point of figuring out what we're pulling. That was the point of the bucket right?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's possible to define the git resource with the release-branch pointing to fedramp branch. Pls take a look here: https://github.ibm.com/instana/autotrace-mutating-webhook/blob/main/ci/fedramp/pipeline.yml#L23-L38

image_resource:
<<: *e2e-test-base-image
inputs:
- name: source-code
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- name: source-code
- name: <source-code-git-resource>

and then you don't need the previous task

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't exactly understand what this is. Can you elaborate?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is in reference to using the git concourse resource instead of manually cloning the repo. Pls check previous comment with the example

Comment on lines +319 to +320
docker://${PRERELEASE_CONTAINER_REPO_URL}@${DIGEST} \
docker://${RELEASE_CONTAINER_REPO_URL}:latest
Copy link
Contributor

Choose a reason for hiding this comment

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

Here we are pushing now both images at the same time. We should keep the existing approach and keep the pipelines as similar to regular releases: push to prerelease, running e2e tests with the prerelease pipeline, pushing to release only images that pass the test.
Also in the release repository, we don't need to copy images with git tag, we can only push them with the v + latest

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm don't understand what is exactly meant by these points. Can you elaborate?

Copy link
Contributor

Choose a reason for hiding this comment

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

The skopeo command pushes both to prerelease and release paths:

 docker://${PRERELEASE_CONTAINER_REPO_URL}@${DIGEST} \
                  docker://${RELEASE_CONTAINER_REPO_URL}:latest

We don't want to do this. The approach we want is to:

  1. push to prerelease
  2. run e2e tests with prerelease image
  3. promote the image to release repo

…ing scheme

Signed-off-by: Fredrik Gundersen <fredrik.gundersen@ibm.com>
- |
echo "Using FedRAMP version: ${FEDRAMP_VERSION}"
# Define the updated repository paths with the correct version
PRERELEASE_CONTAINER_REPO_URL="delivery.instana.io/int-docker-agent-fedramp-prerelease-local/instana-agent-operator/fedramp-v${FEDRAMP_VERSION}/instana-agent-operator"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
PRERELEASE_CONTAINER_REPO_URL="delivery.instana.io/int-docker-agent-fedramp-prerelease-local/instana-agent-operator/fedramp-v${FEDRAMP_VERSION}/instana-agent-operator"
PRERELEASE_CONTAINER_REPO_URL="delivery.instana.io/int-docker-agent-fedramp-prerelease-local/instana-agent-operator/fedramp-${FEDRAMP_VERSION}/instana-agent-operator"

echo "Using FedRAMP version: ${FEDRAMP_VERSION}"
# Define the updated repository paths with the correct version
PRERELEASE_CONTAINER_REPO_URL="delivery.instana.io/int-docker-agent-fedramp-prerelease-local/instana-agent-operator/fedramp-v${FEDRAMP_VERSION}/instana-agent-operator"
RELEASE_CONTAINER_REPO_URL="delivery.instana.io/int-docker-agent-fedramp-release-local/instana-agent-operator/fedramp-v${FEDRAMP_VERSION}/instana-agent-operator"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
RELEASE_CONTAINER_REPO_URL="delivery.instana.io/int-docker-agent-fedramp-release-local/instana-agent-operator/fedramp-v${FEDRAMP_VERSION}/instana-agent-operator"
RELEASE_CONTAINER_REPO_URL="delivery.instana.io/int-docker-agent-fedramp-release-local/instana-agent-operator/fedramp-${FEDRAMP_VERSION}/instana-agent-operator"

# Define the updated repository paths with the correct version
PRERELEASE_CONTAINER_REPO_URL="delivery.instana.io/int-docker-agent-fedramp-prerelease-local/instana-agent-operator/fedramp-v${FEDRAMP_VERSION}/instana-agent-operator"
RELEASE_CONTAINER_REPO_URL="delivery.instana.io/int-docker-agent-fedramp-release-local/instana-agent-operator/fedramp-v${FEDRAMP_VERSION}/instana-agent-operator"
RELEASE_GENERIC_REPO="https://delivery.instana.io/artifactory/int-generic-agent-fedramp-release-local/instana-agent-operator/fedramp-v${FEDRAMP_VERSION}/instana-agent-operator"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
RELEASE_GENERIC_REPO="https://delivery.instana.io/artifactory/int-generic-agent-fedramp-release-local/instana-agent-operator/fedramp-v${FEDRAMP_VERSION}/instana-agent-operator"
RELEASE_GENERIC_REPO="https://delivery.instana.io/artifactory/int-generic-agent-fedramp-release-local/instana-agent-operator/fedramp-${FEDRAMP_VERSION}/instana-agent-operator"

echo "${PRERELEASE_CONTAINER_REPO_URL}" > variables/prerelease-container-repo-url
echo "${RELEASE_CONTAINER_REPO_URL}" > variables/release-container-repo-url
echo "${RELEASE_GENERIC_REPO}" > variables/release-generic-repo-url
echo "fedramp-release-v${FEDRAMP_VERSION}" > variables/release-branch
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, but the release branch won't change every time the fedramp branch changes. The branch will get changes only for new minor releases, but we will keep using fedramp-release-v1.0.0 even when bumping patch releases. Probably the branch name should've been fedramp-release-v1.0.x, but this decision was done outside of our team. So we need here two inputs:

  • fedramp-version resource that should be used for artifactory paths
  • ((local-variables:fedramp-version-default)) which should be used for the branch resource

file: variables/release-branch
reveal: true
# Copy the source code as now we know which version to release with the right branch
- task: clone-source-code
Copy link
Contributor

Choose a reason for hiding this comment

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

It's possible to define the git resource with the release-branch pointing to fedramp branch. Pls take a look here: https://github.ibm.com/instana/autotrace-mutating-webhook/blob/main/ci/fedramp/pipeline.yml#L23-L38

image_resource:
<<: *e2e-test-base-image
inputs:
- name: source-code
Copy link
Contributor

Choose a reason for hiding this comment

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

This is in reference to using the git concourse resource instead of manually cloning the repo. Pls check previous comment with the example

Comment on lines +319 to +320
docker://${PRERELEASE_CONTAINER_REPO_URL}@${DIGEST} \
docker://${RELEASE_CONTAINER_REPO_URL}:latest
Copy link
Contributor

Choose a reason for hiding this comment

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

The skopeo command pushes both to prerelease and release paths:

 docker://${PRERELEASE_CONTAINER_REPO_URL}@${DIGEST} \
                  docker://${RELEASE_CONTAINER_REPO_URL}:latest

We don't want to do this. The approach we want is to:

  1. push to prerelease
  2. run e2e tests with prerelease image
  3. promote the image to release repo

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.

4 participants