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

Making docker user names consistent #5238

Merged

Conversation

tejaswarathe
Copy link
Contributor

@tejaswarathe tejaswarathe commented Dec 2, 2024

Fixes

Fixes #1145 by @dhruvkb

Description

This PR changes the docker usernames for services using different names to a single, meaningful name 'ov_user'.
Changes to the airflow user name have been intentionally left out because the airflow image has to use the airflow user name.

Testing Instructions

Checklist

  • My pull request has a descriptive title (not a vague title likeUpdate index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.
  • I ran the DAG documentation generator (ov just catalog/generate-docs for catalog
    PRs) or the media properties generator (ov just catalog/generate-docs media-props
    for the catalog or ov just api/generate-docs for the API) where applicable.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@tejaswarathe tejaswarathe requested review from a team as code owners December 2, 2024 13:25
@tejaswarathe tejaswarathe requested review from obulat and dhruvkb and removed request for a team December 2, 2024 13:25
@openverse-bot openverse-bot added 🧱 stack: api Related to the Django API 🧱 stack: catalog Related to the catalog and Airflow DAGs 🟩 priority: low Low priority and doesn't need to be rushed ✨ goal: improvement Improvement to an existing user-facing feature 💻 aspect: code Concerns the software code in the repository 🧱 stack: ingestion server Related to the ingestion/data refresh server labels Dec 2, 2024
@tejaswarathe tejaswarathe changed the title changing user name to ov_user Making docker user names consistent Dec 2, 2024
Copy link
Member

@dhruvkb dhruvkb left a comment

Choose a reason for hiding this comment

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

I'm starting with the review of catalog/Dockerfile.

In this file there are a few references to /home/airflow/.... This the path to the $HOME directory when the username is airflow. When the username is changed to ov_user, the path to the $HOME directory will become /home/ov_user/....

Once you make this change, the CI + CD workflow will be able to proceed further and we'll see if the other checks are passing.

catalog/Dockerfile Outdated Show resolved Hide resolved
catalog/Dockerfile Outdated Show resolved Hide resolved
@tejaswarathe tejaswarathe marked this pull request as draft December 3, 2024 06:41
@tejaswarathe
Copy link
Contributor Author

@dhruvkb What exactly is a DC_USER? Do we need to change it as well?

@dhruvkb
Copy link
Member

dhruvkb commented Dec 5, 2024

@tejaswarathe I'm sorry about not checking this earlier but it seems that the airflow image has to use the username of airflow and there is no way around that. They've hardcoded into their Dockerfile in several places.

Can you try reverting the changes to the Airflow code? The CI + CD workflow will be able to run normally then.

@tejaswarathe tejaswarathe marked this pull request as ready for review December 5, 2024 08:45
@tejaswarathe
Copy link
Contributor Author

Reverted the name changes for the catalog, completed the change for API, ingestion_server, indexer_worker.

@dhruvkb
Copy link
Member

dhruvkb commented Dec 5, 2024

I found two more occurrences of "opener" in the code.

# DC_USER=opener

DC_USER := env_var_or_default("DC_USER", "opener")

@tejaswarathe tejaswarathe requested a review from a team as a code owner December 6, 2024 10:19
@tejaswarathe tejaswarathe requested review from krysal and removed request for a team December 6, 2024 10:19
Copy link
Member

@dhruvkb dhruvkb left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @tejaswarathe. LGTM, this is a good normalisation of Docker usernames.

I'll also ask for one more review from another maintainer because it's touching multiple different services but with CI passing, I'm fairly confident that everything is good to go.

Copy link
Member

@krysal krysal 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 to me! Thank you, @tejaswarathe 💯

@krysal krysal merged commit c2d8d64 into WordPress:main Dec 6, 2024
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing user-facing feature 🟩 priority: low Low priority and doesn't need to be rushed 🧱 stack: api Related to the Django API 🧱 stack: catalog Related to the catalog and Airflow DAGs 🧱 stack: ingestion server Related to the ingestion/data refresh server
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Use consistent Docker user names
4 participants