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

Add curl and jq for vttablet-preStop.sh #3

Merged
merged 1 commit into from
Jul 18, 2024
Merged

Add curl and jq for vttablet-preStop.sh #3

merged 1 commit into from
Jul 18, 2024

Conversation

rcrowley
Copy link
Collaborator

We (definitely) need curl and (ideally) jq, too, in order to do our in-place tablet-rolling via vttablet-preStop.sh. So this patch adds curl and jq to the mysqld_exporter container image.

Here's a live container from before this patch:

█ acre:~/src/planetscale/mysqld_exporter % pskr -n user-data exec
vttablet-aws-uswest2a-5-2398428221-2f828e4c -c mysqld-exporter -- which
which
/usr/bin/which
█ acre:~/src/planetscale/mysqld_exporter % pskr -n user-data exec
vttablet-aws-uswest2a-5-2398428221-2f828e4c -c mysqld-exporter -- which
curl
command terminated with exit code 1
█ acre:~/src/planetscale/mysqld_exporter % pskr -n user-data exec
vttablet-aws-uswest2a-5-2398428221-2f828e4c -c mysqld-exporter -- which
jq
command terminated with exit code 1
█ acre:~/src/planetscale/mysqld_exporter %

And here's a new container with this patch:

█ acre:~/src/planetscale/mysqld_exporter % docker buildx build -t
mysqld_exporter:test .
...
█ acre:~/src/planetscale/mysqld_exporter % docker run --entrypoint which
-i -t mysqld_exporter:test which
/usr/bin/which
█ acre:~/src/planetscale/mysqld_exporter % docker run --entrypoint which
-i -t mysqld_exporter:test curl
/usr/bin/curl
█ acre:~/src/planetscale/mysqld_exporter % docker run --entrypoint which
-i -t mysqld_exporter:test jq
/usr/bin/jq
█ acre:~/src/planetscale/mysqld_exporter %

We (definitely) need `curl` and (ideally) `jq`, too, in order to do our
in-place tablet-rolling via `vttablet-preStop.sh`. So this patch adds
`curl` and `jq` to the `mysqld_exporter` container image.

Here's a live container from before this patch:

    █ acre:~/src/planetscale/mysqld_exporter % pskr -n user-data exec
    vttablet-aws-uswest2a-5-2398428221-2f828e4c -c mysqld-exporter -- which
    which
    /usr/bin/which
    █ acre:~/src/planetscale/mysqld_exporter % pskr -n user-data exec
    vttablet-aws-uswest2a-5-2398428221-2f828e4c -c mysqld-exporter -- which
    curl
    command terminated with exit code 1
    █ acre:~/src/planetscale/mysqld_exporter % pskr -n user-data exec
    vttablet-aws-uswest2a-5-2398428221-2f828e4c -c mysqld-exporter -- which
    jq
    command terminated with exit code 1
    █ acre:~/src/planetscale/mysqld_exporter %

And here's a new container with this patch:

    █ acre:~/src/planetscale/mysqld_exporter % docker buildx build -t
    mysqld_exporter:test .
    ...
    █ acre:~/src/planetscale/mysqld_exporter % docker run --entrypoint which
    -i -t mysqld_exporter:test which
    /usr/bin/which
    █ acre:~/src/planetscale/mysqld_exporter % docker run --entrypoint which
    -i -t mysqld_exporter:test curl
    /usr/bin/curl
    █ acre:~/src/planetscale/mysqld_exporter % docker run --entrypoint which
    -i -t mysqld_exporter:test jq
    /usr/bin/jq
    █ acre:~/src/planetscale/mysqld_exporter %
COPY --from=build /mysqld_exporter/mysqld_exporter /bin/mysqld_exporter
EXPOSE 9104
USER nobody
WORKDIR /

Choose a reason for hiding this comment

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

is this required for anything or just a nice to have?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oops. It's a non-functional change I had teed up in my work tree in case I ever needed a dummy change to force the CI through another loop. I actually like it being in because otherwise the working directory is /go which is harmless but kind of nonsense.

@rcrowley rcrowley merged commit e934e9d into main Jul 18, 2024
1 check passed
@rcrowley rcrowley deleted the curl-jq branch July 18, 2024 18:30
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.

2 participants