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

Fix permissions for synthetics docker image #23576

Merged
merged 1 commit into from
Jan 21, 2021

Conversation

andrewvc
Copy link
Contributor

@andrewvc andrewvc commented Jan 19, 2021

The permissions were incorrect, and mostly set for the wrong UID, running synthetic monitors would fail completely. This fixes that, performing most tasks as a regular user.

Fixes: #23577

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.

How to test this PR locally

Run env PLATFORMS="+all linux/amd64" mage package in x-pack/heartbeat. Then, using the synthetics repo, run ./run.sh docker.elastic.co/beats/heartbeat:8.0.0 from the examples/docker dir.

The permissions were incorrect, and mostly set for the wrong UID. This
fixes that, performing most tasks as a regular user.
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 19, 2021
@andrewvc andrewvc self-assigned this Jan 19, 2021
@andrewvc andrewvc added bug Heartbeat Team:obs-ds-hosted-services Label for the Observability Hosted Services team labels Jan 19, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/uptime (Team:Uptime)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jan 19, 2021
@andrewvc
Copy link
Contributor Author

/packaging
/package

@elasticmachine
Copy link
Collaborator

💚 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

Expand to view the summary

Build stats

  • Build Cause: Pull request #23576 opened

    • Start Time: 2021-01-19T23:44:09.094+0000
  • Duration: 92 min 4 sec

  • Commit: 895e59a

Test stats 🧪

Test Results
Failed 0
Passed 17315
Skipped 1346
Total 18661

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 17315
Skipped 1346
Total 18661

Copy link
Member

@vigneshshanmugam vigneshshanmugam 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, tested the new image with synthetics examples and it works 🎉 .

# Setup node
RUN cd /usr/share/heartbeat/.node \
&& mkdir -p node \
&& curl https://nodejs.org/dist/v12.18.4/node-v12.18.4-linux-x64.tar.xz | tar -xJ --strip 1 -C node \
Copy link
Member

Choose a reason for hiding this comment

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

use NODE_VERSION var here as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's fix this in a follow-up, I think we want to bump this version before beta anyway.

&& mkdir -p node \
&& curl https://nodejs.org/dist/v12.18.4/node-v12.18.4-linux-x64.tar.xz | tar -xJ --strip 1 -C node \
&& chmod ug+rwX -R $NODE_PATH \
&& npm i -g -f @elastic/synthetics && chmod ug+rwX -R $NODE_PATH
Copy link
Member

Choose a reason for hiding this comment

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

do we still need -f for this as this happens only when we build the heartbeat image?

Copy link
Contributor Author

@andrewvc andrewvc Jan 21, 2021

Choose a reason for hiding this comment

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

Given that this is tested and works, I'd rather postpone this change to a subsequent PR and unbreak the current build

@andrewvc andrewvc merged commit f527935 into elastic:master Jan 21, 2021
@andrewvc andrewvc deleted the fix-synth-docker branch January 21, 2021 17:00
andrewvc added a commit to andrewvc/beats that referenced this pull request Jan 21, 2021
The permissions were incorrect, and mostly set for the wrong UID. This
fixes that, performing most tasks as a regular user.

(cherry picked from commit f527935)
andrewvc added a commit that referenced this pull request Jan 22, 2021
The permissions were incorrect, and mostly set for the wrong UID. This
fixes that, performing most tasks as a regular user.

(cherry picked from commit f527935)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Heartbeat Team:obs-ds-hosted-services Label for the Observability Hosted Services team v7.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Heartbeat] Fix broken file permissions in 7.11 docker image
4 participants