Convert Docker startup scripts to python#375
Closed
MoralCode wants to merge 68 commits into
Closed
Conversation
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
…ode slowly over time Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Co-authored-by: Shlok Gilda <gildashlok@hotmail.com> Signed-off-by: Adrian Edwards <17362949+MoralCode@users.noreply.github.com>
Co-authored-by: Shlok Gilda <gildashlok@hotmail.com> Signed-off-by: Adrian Edwards <17362949+MoralCode@users.noreply.github.com>
Co-authored-by: Shlok Gilda <gildashlok@hotmail.com> Signed-off-by: Adrian Edwards <17362949+MoralCode@users.noreply.github.com>
impact: low due to the new env variable interpretation layer Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
…s where env vars are explicitly needed in the CLI Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
itll start as deprecated since there are already plans to make this better. Signed-off-by: Adrian Edwards <adredwar@redhat.com>
…d from two places in the CLI Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
…autoimport locations Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
so it doesn't import CollectOSS Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
github keys being put in wrong places Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
| from pathlib import Path | ||
| import os | ||
| import getpass | ||
| import subprocess |
| import os | ||
| import getpass | ||
| import subprocess | ||
| from subprocess import check_call |
| """ | ||
| pass | ||
| # alembic upgrade head, unless theres an env var preventing automatic migration | ||
| check_call(["alembic", "upgrade", "head"]) |
| """ | ||
| pass | ||
| # alembic upgrade head, unless theres an env var preventing automatic migration | ||
| check_call(["alembic", "upgrade", "head"]) |
| with git_credentials.open("w", encoding="utf-8") as c: | ||
| c.writelines(credentials) | ||
|
|
||
| subprocess.call(["git", "config", "--global", "credential.helper", f"store --file {str(git_credentials)}"]) |
| with git_credentials.open("w", encoding="utf-8") as c: | ||
| c.writelines(credentials) | ||
|
|
||
| subprocess.call(["git", "config", "--global", "credential.helper", f"store --file {str(git_credentials)}"]) |
| @@ -130,7 +147,7 @@ def start(ctx, disable_collection, development, pidfile, port): | |||
| processes = start_celery_worker_processes((core_worker_count, secondary_worker_count, facade_worker_count), disable_collection) | |||
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
W0621: Redefining name 'processes' from outer scope (line 412) (redefined-outer-name)
| @@ -15,6 +15,7 @@ | |||
| import requests | |||
| from redis.exceptions import ConnectionError as RedisConnectionError | |||
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
W0611: Unused ConnectionError imported from redis.exceptions as RedisConnectionError (unused-import)
| import sqlalchemy as s | ||
|
|
||
| from collectoss.util.startup import check_init_schema, check_update_schema, collect_env_variables, print_platform_information, setup_facade_directory, warn_import_repos, merge_config | ||
| from keyman.KeyClient import KeyClient, KeyPublisher |
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
W0611: Unused KeyClient imported from keyman.KeyClient (unused-import)
| import platform | ||
| import sys | ||
|
|
||
| from sqlalchemy.orm.attributes import get_history |
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
W0611: Unused get_history imported from sqlalchemy.orm.attributes (unused-import)
Contributor
Author
|
Just kidding. Without this PR, the CI is failing for the PR this depends on. ill just do them together |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is a followup to #311 to address the uses of environment variables that are present in scripts like
entrypoint.shinit.shandconfig.shthat are part of the docker startup process for CollectOSS.These bash scripts would be very difficult to hack in support for reading from two different variable prefixes, and I decided it was a better use of effort to move the behaviors of these scripts into python.
This PR is that last piece last piece of fixing the environment variable naming subtask of #279
Notes for Reviewers
Signed commits