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

[ES-8436] feat: Change Dockerfile base images to Wolfi #1871

Merged
merged 13 commits into from
Sep 27, 2024

Conversation

favilo
Copy link
Contributor

@favilo favilo commented Aug 31, 2024

Running the docker image with a mounted /rally/.rally directory that already contains the configuration file didn't work. So I had to change how we parse the logging config and rally.ini files.

Now we dealy the parsing of the environment variables to read time, to make running from docker and outside of docker compatible with each other.

This will require changes to the buildkite scripts to allow pushing a regular docker image for use with nightlies, and potentially rebuilding older images when vulnerabilities are found.

@favilo favilo requested a review from a team August 31, 2024 00:58
@favilo favilo changed the title feat: Change Dockerfile base images to Wolfi [ES-8436] feat: Change Dockerfile base images to Wolfi Aug 31, 2024
Running the docker image with a mounted `/rally/.rally` directory that
already contains the configuration file didn't work. So I had to change
how we parse the logging config and rally.ini files.

Now we dealy the parsing of the environment variables to read time, to
make running from docker and outside of docker compatible with each
other.
I'd been installing `esrally` to the wrong location, now it's correctly
in venv/bin
@favilo favilo requested review from a team and gareth-ellis September 19, 2024 23:41
Copy link
Contributor

@gbanasiak gbanasiak left a comment

Choose a reason for hiding this comment

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

This looks good. I like the increased portability the delayed resolution of ${CONFIG_DIR} and ${LOG_PATH} variables offer but I think this should get proper description in here and here. It could also be useful to mention it in Docker section, perhaps here?

Comment on lines -100 to -101
# the logging path might contain backslashes that we need to escape
log_path = io.escape_path(log_path)
Copy link
Contributor

Choose a reason for hiding this comment

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

We're dropping backlash escaping which was meant to help with Windows judging by #829. But we never officially supported Windows so I'm fine with it.

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, how did I not see this? I am happy to add this logic back to the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, on second thought, this would only have been valuable when we were writing the file out to disk for deserialization later. Since we are doing the replacement on the fly, it should still work, even on Windows

# Build stage 0 `builder`:
# Install Rally from source inside a virtualenv
################################################################################
FROM docker.elastic.co/wolfi/python:3.11.7-dev AS builder
Copy link
Contributor

@gbanasiak gbanasiak Sep 22, 2024

Choose a reason for hiding this comment

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

This is probably a good opportunity to define the rule going forward. Will we keep this version aligned with the version of the nightlies (3.11.x), or perhaps we should bump it up all the way to the newest supported version (3.12.x)?

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 think I tried 3.12 and it wasn't playing nice, but I could also be remembering something else. I don't mind pinning it to the newest version we support.

Copy link
Contributor

@gbanasiak gbanasiak left a comment

Choose a reason for hiding this comment

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

LGTM. One cosmetic docs change needed.

docs/docker.rst Outdated
Comment on lines 74 to 77
make the files more portable. For example::

* In ``rally.ini``, you can set ``root.dir = ${CONFIG_DIR}/benchmarks`` instead of hard-coding the path as ``/rally/.rally/benchmarks``
* In ``logging.json``, you can set ``"filename": "${LOG_PATH}/rally.log"`` instead of hard-coding the path as ``"filename": "/rally/.rally/logs/rally.log"``
Copy link
Contributor

@gbanasiak gbanasiak Sep 24, 2024

Choose a reason for hiding this comment

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

This bulleted list does not look good in the preview. Double colon perhaps?

@favilo favilo enabled auto-merge (squash) September 27, 2024 18:38
@favilo favilo merged commit 75c8070 into elastic:master Sep 27, 2024
17 checks passed
@favilo favilo deleted the docker-refresh branch September 27, 2024 20:29
@favilo favilo added this to the 2.11.1 milestone Nov 6, 2024
@favilo favilo added the enhancement Improves the status quo label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improves the status quo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants