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

MGMT-16517: Add Env Var for On-Prem Data Deployment Type #5874

Merged
merged 2 commits into from Jan 31, 2024

Conversation

CrystalChun
Copy link
Contributor

MGMT-16517
Adds the environment variables DEPLOYMENT_TYPE
and DEPLOYMENT_VERSION to determine how assisted was deployed. Expected values for deployment type
include ACM, MCE, ABI, podman, standalone operator.

Also changes the versions file to metadata file to encompass the new data.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

/cc @rccrdpccl

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 9, 2024
@openshift-ci openshift-ci bot requested a review from rccrdpccl January 9, 2024 22:27
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 9, 2024

@CrystalChun: This pull request references MGMT-16517 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.16.0" version, but no target version was set.

In response to this:

MGMT-16517
Adds the environment variables DEPLOYMENT_TYPE
and DEPLOYMENT_VERSION to determine how assisted was deployed. Expected values for deployment type
include ACM, MCE, ABI, podman, standalone operator.

Also changes the versions file to metadata file to encompass the new data.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

/cc @rccrdpccl

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 9, 2024
Copy link

openshift-ci bot commented Jan 9, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CrystalChun

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 9, 2024
Copy link

codecov bot commented Jan 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7825b85) 68.11% compared to head (6c5a61f) 68.54%.
Report is 23 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5874      +/-   ##
==========================================
+ Coverage   68.11%   68.54%   +0.43%     
==========================================
  Files         235      236       +1     
  Lines       34637    35305     +668     
==========================================
+ Hits        23592    24200     +608     
- Misses       8984     9014      +30     
- Partials     2061     2091      +30     
Files Coverage Δ
internal/uploader/events_uploader.go 68.94% <100.00%> (+1.62%) ⬆️
internal/uploader/uploader.go 0.00% <ø> (ø)

... and 13 files with indirect coverage changes

@rccrdpccl
Copy link
Contributor

/retest

metadata["deployment-version"] = config.DeploymentVersion

if metadataJson, err := json.Marshal(metadata); err == nil {
addFile(tw, metadataJson, fmt.Sprintf("%s/metadata.json", *clusterID)) //nolint:errcheck // errors adding this file shouldn't prevent the data from being sent
Copy link
Contributor

Choose a reason for hiding this comment

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

I know that we briefly discussed this, but I now realize that this would break the consumer. If necessary we can change the consumer first to handle both cases, but I think it'd be best to keep compatibility and just add metadata.json and versions.json separately. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh gotcha, sure a separate file will work! I'll modify this to reflect it momentarily

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 kept the version in the metadata file too so that when the versions.json file is removed, it'll already be part of the metadata.json file.

@rccrdpccl
Copy link
Contributor

Can we add in the same PR manifest change for the default saas template and the podman/tests template?

@CrystalChun CrystalChun force-pushed the onprem-type branch 2 times, most recently from 7d8dfa6 to d62d856 Compare January 12, 2024 01:00
@CrystalChun
Copy link
Contributor Author

Can we add in the same PR manifest change for the default saas template and the podman/tests template?

Added! Did I add it to the correct places?

https://issues.redhat.com/browse/MGMT-16517
Adds the environment variables `DEPLOYMENT_TYPE`
and `DEPLOYMENT_VERSION` to determine how assisted
was deployed. Expected values for deployment type
include ACM, MCE, ABI, podman, standalone operator.
@gamli75
Copy link
Contributor

gamli75 commented Jan 24, 2024

/test e2e-agent-compact-ipv4

@CrystalChun CrystalChun force-pushed the onprem-type branch 2 times, most recently from 1d909aa to 6f9f5b1 Compare January 25, 2024 21:53
Copy link
Contributor

@rccrdpccl rccrdpccl left a comment

Choose a reason for hiding this comment

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

I think we cover most use cases:

  • saas/rest mode
  • kube api (infrastructure operator, MCE, ACM)
    There are a few other deployment types that seems that are not covered

deploy/assisted-service.yaml Show resolved Hide resolved
@rccrdpccl
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 30, 2024
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 268d4ed and 2 for PR HEAD 6c5a61f in total

Copy link

openshift-ci bot commented Jan 30, 2024

@CrystalChun: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 05daf90 into openshift:master Jan 31, 2024
14 checks passed
@CrystalChun
Copy link
Contributor Author

/cherry-pick release-ocm-2.9

@openshift-cherrypick-robot

@CrystalChun: new pull request created: #5979

In response to this:

/cherry-pick release-ocm-2.9

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@CrystalChun
Copy link
Contributor Author

/cherry-pick release-4.14

@openshift-cherrypick-robot

@CrystalChun: #5874 failed to apply on top of branch "release-4.14":

Applying: MGMT-16517: Add Env Var for On-Prem Data Deployment Type
Using index info to reconstruct a base tree...
M	internal/uploader/events_uploader.go
M	internal/uploader/events_uploader_test.go
M	internal/uploader/uploader.go
Falling back to patching base and 3-way merge...
Auto-merging internal/uploader/uploader.go
Auto-merging internal/uploader/events_uploader_test.go
CONFLICT (content): Merge conflict in internal/uploader/events_uploader_test.go
Auto-merging internal/uploader/events_uploader.go
CONFLICT (content): Merge conflict in internal/uploader/events_uploader.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 MGMT-16517: Add Env Var for On-Prem Data Deployment Type
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-4.14

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@CrystalChun
Copy link
Contributor Author

/cherry-pick release-4.15

@openshift-cherrypick-robot

@CrystalChun: new pull request created: #5982

In response to this:

/cherry-pick release-4.15

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

CrystalChun added a commit to CrystalChun/assisted-service that referenced this pull request Feb 13, 2024
)

* MGMT-16517: Add Env Var for On-Prem Data Deployment Type

https://issues.redhat.com/browse/MGMT-16517
Adds the environment variables `DEPLOYMENT_TYPE`
and `DEPLOYMENT_VERSION` to determine how assisted
was deployed. Expected values for deployment type
include ACM, MCE, ABI, podman, standalone operator.

* MGMT-16517: Add Env Var to podman and SaaS templates

https://issues.redhat.com/browse/MGMT-16517
CrystalChun added a commit to CrystalChun/assisted-service that referenced this pull request Feb 13, 2024
)

* MGMT-16517: Add Env Var for On-Prem Data Deployment Type

https://issues.redhat.com/browse/MGMT-16517
Adds the environment variables `DEPLOYMENT_TYPE`
and `DEPLOYMENT_VERSION` to determine how assisted
was deployed. Expected values for deployment type
include ACM, MCE, ABI, podman, standalone operator.

* MGMT-16517: Add Env Var to podman and SaaS templates

https://issues.redhat.com/browse/MGMT-16517
openshift-merge-bot bot pushed a commit that referenced this pull request Feb 16, 2024
* NO-ISSUE: Add versions file to onprem event upload (#5514)

* MGMT-16517: Add Env Var for On-Prem Data Deployment Type (#5874)

* MGMT-16517: Add Env Var for On-Prem Data Deployment Type

https://issues.redhat.com/browse/MGMT-16517
Adds the environment variables `DEPLOYMENT_TYPE`
and `DEPLOYMENT_VERSION` to determine how assisted
was deployed. Expected values for deployment type
include ACM, MCE, ABI, podman, standalone operator.

* MGMT-16517: Add Env Var to podman and SaaS templates

https://issues.redhat.com/browse/MGMT-16517

* MGMT-16523: Set ABI deployment type for on-prem data collection (#5967)

https://issues.redhat.com/browse/MGMT-16523
The agent team sets the env var INSTALL_INVOKER to "agent-installer"
during their deployment. This can be used to determine that it's
an ABI deployment in our on-prem data collection.
CrystalChun added a commit to CrystalChun/assisted-service that referenced this pull request Feb 22, 2024
)

* MGMT-16517: Add Env Var for On-Prem Data Deployment Type

https://issues.redhat.com/browse/MGMT-16517
Adds the environment variables `DEPLOYMENT_TYPE`
and `DEPLOYMENT_VERSION` to determine how assisted
was deployed. Expected values for deployment type
include ACM, MCE, ABI, podman, standalone operator.

* MGMT-16517: Add Env Var to podman and SaaS templates

https://issues.redhat.com/browse/MGMT-16517
openshift-merge-bot bot pushed a commit that referenced this pull request Feb 22, 2024
* MGMT-16517: Add Env Var for On-Prem Data Deployment Type (#5874)

* MGMT-16517: Add Env Var for On-Prem Data Deployment Type

https://issues.redhat.com/browse/MGMT-16517
Adds the environment variables `DEPLOYMENT_TYPE`
and `DEPLOYMENT_VERSION` to determine how assisted
was deployed. Expected values for deployment type
include ACM, MCE, ABI, podman, standalone operator.

* MGMT-16517: Add Env Var to podman and SaaS templates

https://issues.redhat.com/browse/MGMT-16517

* MGMT-16523: Set ABI deployment type for on-prem data collection (#5967)

https://issues.redhat.com/browse/MGMT-16523
The agent team sets the env var INSTALL_INVOKER to "agent-installer"
during their deployment. This can be used to determine that it's
an ABI deployment in our on-prem data collection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants