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

K8SPSMDB-948: Multi arch build #1356

Merged
merged 2 commits into from
Jan 17, 2024
Merged

K8SPSMDB-948: Multi arch build #1356

merged 2 commits into from
Jan 17, 2024

Conversation

sergelogvinov
Copy link
Contributor

@sergelogvinov sergelogvinov commented Oct 9, 2023

K8SPSMDB-948 Powered by Pull Request Badge

CHANGE DESCRIPTION

Problem:

https://jira.percona.com/browse/K8SPSMDB-948
https://forums.percona.com/t/mongo-operator-and-arm/24326

Cause:

Multi arch image.

Solution:

Hello,

This small changes allows to build PSMDB for different architectures.

make build DOCKER_DEFAULT_PLATFORM=linux/amd64,linux/arm64 IMAGE=ghcr.io/sergelogvinov/percona-server-mongodb-operator:v1.14.0

the result image: ghcr.io/sergelogvinov/percona-server-mongodb-operator:v1.14.0

In my opinion, it is better to make refactoring of files: Dockerfile, e2e-tests/build to speedup the build.
Also you need to have buildkit in your CI/CD (jenkins) machine. Github Action already has everything that we need for it.

PS. I can make github action for you (build/push releases to github registry).

Thanks.

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?
  • Are OpenShift compare files changed for E2E tests (compare/*-oc.yml)?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are the manifests (crd/bundle) regenerated if needed?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported MongoDB version?
  • Does the change support oldest and newest supported Kubernetes version?

@CLAassistant
Copy link

CLAassistant commented Oct 9, 2023

CLA assistant check
All committers have signed the CLA.

@aleksasiriski
Copy link

This would fix #1394

Copy link
Collaborator

@hors hors left a comment

Choose a reason for hiding this comment

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

@sergelogvinov please check percona/percona-xtradb-cluster-operator#1550 and correct your PR a little bet and we can merge

@sergelogvinov
Copy link
Contributor Author

@hors done, thank you!

@sergelogvinov sergelogvinov force-pushed the buildx branch 3 times, most recently from 5b7e006 to c0e434e Compare December 14, 2023 17:55
@egegunes
Copy link
Contributor

@sergelogvinov please fix conflicts, we want to have this in next release

@egegunes egegunes added this to the v1.16.0 milestone Jan 12, 2024
An easy way to build PSMDB for different architectures.

Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
@pull-request-size pull-request-size bot added size/M 30-99 lines and removed size/L 100-499 lines labels Jan 16, 2024
@sergelogvinov
Copy link
Contributor Author

@egegunes done
Thanks.

@hors hors self-requested a review January 16, 2024 08:52
Copy link
Collaborator

@hors hors left a comment

Choose a reason for hiding this comment

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

@sergelogvinov as you can see build does not work. The following line https://github.com/percona/percona-xtradb-cluster-operator/blob/main/Jenkinsfile#L342 will fix it. Please add it.

@sergelogvinov
Copy link
Contributor Author

@sergelogvinov as you can see build does not work. The following line https://github.com/percona/percona-xtradb-cluster-operator/blob/main/Jenkinsfile#L342 will fix it. Please add it.

Unfortunately I cannot see the build logs (Access Denied)...
But the line docker buildx create --use already in Jenkinsfile.
Can you copy/past the logs?

Thanks.

@hors
Copy link
Collaborator

hors commented Jan 17, 2024

@sergelogvinov as you can see build does not work. The following line https://github.com/percona/percona-xtradb-cluster-operator/blob/main/Jenkinsfile#L342 will fix it. Please add it.

Unfortunately I cannot see the build logs (Access Denied)... But the line docker buildx create --use already in Jenkinsfile. Can you copy/past the logs?

Thanks.

It is strange :( yes you are right it was added, but from log, I can see the following:

09:10:39  + sg docker -c '
09:10:39                                  set -ex
09:10:39                                  export RELEASE=0
09:10:39                                  export IMAGE=perconalab/percona-server-mongodb-operator:PR-1356-840c5bef
09:10:39                                  ./e2e-tests/build
09:10:39                                  docker logout
09:10:39                              '

something is wrong. I will try to check as well.

@hors hors merged commit b9f94ba into percona:main Jan 17, 2024
9 of 10 checks passed
@hors
Copy link
Collaborator

hors commented Jan 17, 2024

@sergelogvinov, thanks for your contribution

@sergelogvinov sergelogvinov deleted the buildx branch January 17, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants