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

Modify magefile to accomdate new M1 cross compile images #500

Merged
merged 3 commits into from
Jun 6, 2022

Conversation

DaveSys911
Copy link
Contributor

@DaveSys911 DaveSys911 commented Jun 2, 2022

What does this PR do?

Modifies magefile to use new docker images for cross-compile on M1/arch elastic/beats#31779.
See issue elastic/golang-crossbuild#153

Why is it important?

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • [ ]

How to test this PR locally

Check out pr elastic/beats#31779 in beats and run DEV=true SNAPSHOT=TRUE EXTERNAL=TRUE PLATFORMS=linux/arm64 TYPES=docker mage -v package from within the agent repo

Related issues

Use cases

Screenshots

Logs

[
    {
        "Id": "sha256:ca9451c7065756a57bb6092fe8c2e24672d123472d736bf1e3562c81aa4998bd",
        "RepoTags": [
            "docker.elastic.co/beats/elastic-agent:8.4.0-SNAPSHOT"
        ],
        "RepoDigests": [],
        "Parent": "",
        "Comment": "buildkit.dockerfile.v0",
        "Created": "2022-06-02T15:55:36.753152089Z",
        "Container": "",
        "ContainerConfig": {
            "Hostname": "",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": null,
            "Cmd": null,
            "Image": "",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": null
        },
        "DockerVersion": "",
        "Author": "",
        "Config": {
            "Hostname": "",
            "Domainname": "",
            "User": "elastic-agent",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/share/elastic-agent:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "BEAT_SETUID_AS=elastic-agent",
                "ELASTIC_CONTAINER=true",
                "GODEBUG=madvdontneed=1",
                "LIBBEAT_MONITORING_CGROUPS_HIERARCHY_OVERRIDE=/"
            ],
            "Cmd": null,
            "Image": "",
            "Volumes": null,
            "WorkingDir": "/usr/share/elastic-agent",
            "Entrypoint": [
                "/usr/bin/tini",
                "--",
                "/usr/local/bin/docker-entrypoint"
            ],
            "OnBuild": null,
            "Labels": {
                "description": "Agent manages other beats based on configuration provided.",
                "io.k8s.description": "Agent manages other beats based on configuration provided.",
                "io.k8s.display-name": "Elastic-Agent image",
                "license": "Elastic License",
                "maintainer": "[email protected]",
                "name": "elastic-agent",
                "org.label-schema.build-date": "2022-06-02T15:52:47Z",
                "org.label-schema.license": "Elastic License",
                "org.label-schema.name": "elastic-agent",
                "org.label-schema.schema-version": "1.0",
                "org.label-schema.url": "https://www.elastic.co/beats/elastic-agent",
                "org.label-schema.vcs-ref": "857b681dc5802e4ee82c3aa6855f9a5412181fb9",
                "org.label-schema.vcs-url": "github.com/elastic/elastic-agent",
                "org.label-schema.vendor": "Elastic",
                "org.label-schema.version": "8.4.0-SNAPSHOT",
                "org.opencontainers.image.created": "2022-06-02T15:52:47Z",
                "org.opencontainers.image.licenses": "Elastic License",
                "org.opencontainers.image.title": "Elastic-Agent",
                "org.opencontainers.image.vendor": "Elastic",
                "release": "1",
                "summary": "elastic-agent",
                "url": "https://www.elastic.co/beats/elastic-agent",
                "vendor": "Elastic",
                "version": "8.4.0-SNAPSHOT"
            }
        },
        "Architecture": "arm64",
        "Variant": "v8",
        "Os": "linux",
        "Size": 1483632954,
        "VirtualSize": 1483632954,
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/idhs7vtyjjixh18ackanesi9w/diff:/var/lib/docker/overlay2/l12hzgvilgfvlaupn6zoc24ps/diff:/var/lib/docker/overlay2/ggo2z9trgcax0tt3q53t19jio/diff:/var/lib/docker/overlay2/fncuort16scuv2t358uok8ot1/diff:/var/lib/docker/overlay2/0rkwl6wt6adsuz0oaz4r7m7ts/diff:/var/lib/docker/overlay2/94mujnprz4hmb0kqv9ghxrfqz/diff:/var/lib/docker/overlay2/0yzjq4k49m5l4xu4uxc3p5v13/diff:/var/lib/docker/overlay2/t56ab2wc0fhw7kanmbffb0fr9/diff:/var/lib/docker/overlay2/k8ez123adv97gp3m3q9zll1rj/diff:/var/lib/docker/overlay2/kg86iya712mvttr5s8n08potu/diff:/var/lib/docker/overlay2/twxlc7x045ei8pwkzbr6n2o50/diff:/var/lib/docker/overlay2/8w5cyo4cdjj74guv1gybuf6y1/diff:/var/lib/docker/overlay2/276beedb128fc56b0273ca72b5df24e73ea9253d2ebf154337ce7dc7c89d6ab1/diff",
                "MergedDir": "/var/lib/docker/overlay2/v84i3k38crogbm6jpwj3ph239/merged",
                "UpperDir": "/var/lib/docker/overlay2/v84i3k38crogbm6jpwj3ph239/diff",
                "WorkDir": "/var/lib/docker/overlay2/v84i3k38crogbm6jpwj3ph239/work"
            },
            "Name": "overlay2"
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:e265835b28ac16782ef429b44427c7a72cdefc642794515d78a390a72a2eab42",
                "sha256:50fd10747d0c3c8a5dc78a95ad185d17686c42466c4b8cae65c907821aea6763",
                "sha256:d054b8d90973526b421644e4c3f1aee8a4843585d270aa3b8819bc6350342fa2",
                "sha256:dd723fa89ebe3d2faf8d3c322cc95216dc472af025d7ed2dcd8ff2f2ea6cb165",
                "sha256:aa06c70a0496a4574ae4dda10ee573712fa85a17f6d4a112b4790eb0454b7de4",
                "sha256:45248ec865363e3e2dfa14e4dec0efeb65783a094f0fd4c38777a7ac723ba131",
                "sha256:f80b23844aced45a1e16c2e96f414a20ba8c50f973a4752bea9e309da9bcbd59",
                "sha256:aa0c1c7e08c18bf271dba60ea00d9247eff6edc221374acdfe328cec939781da",
                "sha256:d9d75ad851a07e9b07bc76645c26fa3c45906159345d016e47a76acdd0040472",
                "sha256:8ed672ce63b357b6d7681c96c9207c5cd38dd0b72aeeacb7774dbe0fccdded8e",
                "sha256:1ba8d2f9445273f4a589cd4c14479d35c556227f6fb9c32eb2f7fedc75c1ed31",
                "sha256:d4f84fe81adc48d3b304d20e1e0ee0e3c6b6d44378db7ca2323fab267c7db698",
                "sha256:5ab8453592ce781030fab8a2bbe73b821e030aff3f8c2421cc5acb43765ac859",
                "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef"
            ]
        },
        "Metadata": {
            "LastTagTime": "2022-06-02T15:55:39.896361299Z"
        }
    }
]

@mergify
Copy link
Contributor

mergify bot commented Jun 2, 2022

This pull request does not have a backport label. Could you fix it @DaveSys911? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip label Jun 2, 2022
@DaveSys911 DaveSys911 changed the title Adapted magefile to accomdate new M1 cross compile images Modify magefile to accomdate new M1 cross compile images Jun 2, 2022
@DaveSys911 DaveSys911 requested review from kuisathaverat and narph June 2, 2022 16:05
@DaveSys911 DaveSys911 marked this pull request as ready for review June 2, 2022 16:07
@DaveSys911 DaveSys911 requested a review from a team as a code owner June 2, 2022 16:07
@DaveSys911 DaveSys911 requested review from michalpristas and removed request for a team June 2, 2022 16:07
@elasticmachine
Copy link
Contributor

elasticmachine commented Jun 2, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-06-06T13:24:34.002+0000

  • Duration: 16 min 40 sec

Test stats 🧪

Test Results
Failed 0
Passed 5973
Skipped 23
Total 5996

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages.

  • run integration tests : Run the Elastic Agent Integration tests.

  • run end-to-end tests : Generate the packages and run the E2E Tests.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Contributor

elasticmachine commented Jun 2, 2022

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 97.183% (69/71) 👍
Files 68.493% (150/219) 👍
Classes 68.109% (299/439) 👍
Methods 51.733% (821/1587) 👍 0.033
Lines 38.105% (8805/23107) 👍 0.033
Conditionals 100.0% (0/0) 💚

@ph ph requested a review from AndersonQ June 2, 2022 16:25
@ph
Copy link
Contributor

ph commented Jun 2, 2022

@AndersonQ or @michalpristas can you review this you both have m1.

@aleksmaus
Copy link
Contributor

Wohooo! This is awesome!
Thank you, thank you, thank you!

Screen Shot 2022-06-02 at 4 18 29 PM

@AndersonQ
Copy link
Member

@AndersonQ or @michalpristas can you review this you both have m1.

I don't have a M1, it always worked on my machine :)

anyway, LGTM

@DaveSys911
Copy link
Contributor Author

@jlind23 @ph @cmacknz I can't merge this due to not being authorized(see below)
Can someone merge this, please?

@aleksmaus
Copy link
Contributor

@jlind23 @ph @cmacknz I can't merge this due to not being authorized(see below) Can someone merge this, please?

David, I can merge once all the checks clear. Do, you need to merge the beats branch too before this?

@DaveSys911
Copy link
Contributor Author

@aleksmaus that would be great, waiting for @michalpristas to approve

@DaveSys911 DaveSys911 added the backport-v8.3.0 Automated backport with mergify label Jun 6, 2022
@mergify mergify bot removed the backport-skip label Jun 6, 2022
@michalpristas michalpristas merged commit 4e6d977 into elastic:main Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.3.0 Automated backport with mergify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants