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

Refactor Dockerfile and scripts #1501

Merged
merged 14 commits into from May 19, 2021

Conversation

alexshtin
Copy link
Member

@alexshtin alexshtin commented Apr 28, 2021

What changed?
Refactor Dockerfile and scripts.

Why?

  1. Run ES index template creator only for auto setup.
  2. Invoke scripts in more natural order: entrypoint.sh -> auto-setup.sh (optional), setup-develop.sh (optional), start-temporal.sh -> exec temporal-server.
  3. Copy only needed files for every image.
  4. Copy scripts to /etc/temporal instead of the root.
  5. Some renames.
  6. Comply with shellcheck.

How did you test it?
Build locally and run with docker-compose.

Potential risks
RF env was renamed to CASSANDRA_REPLICATION_FACTOR.

Is hotfix candidate?
No.

@alexshtin alexshtin requested a review from a team April 28, 2021 00:38
@alexshtin alexshtin requested a review from underrun April 28, 2021 01:07
docker/auto-setup.sh Outdated Show resolved Hide resolved
docker/auto-setup.sh Outdated Show resolved Hide resolved
docker/auto-setup.sh Show resolved Hide resolved

wait_for_cassandra() {
# TODO (alex): Remove exports
export CASSANDRA_USER=$CASSANDRA_USER
Copy link
Contributor

Choose a reason for hiding this comment

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

if you are exporting a variable that's already set you can just do

    export CASSANDRA_USER
    export CASSANDRA_PORT

etc

Copy link
Member Author

Choose a reason for hiding this comment

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

I would leave it as is for now and refactor later as part of TODO above.

export CASSANDRA_TLS_KEY=$CASSANDRA_CERT_KEY
export CASSANDRA_TLS_CA=$CASSANDRA_CA

{ export CASSANDRA_PASSWORD=$CASSANDRA_PASSWORD; } 2> /dev/null
Copy link
Contributor

Choose a reason for hiding this comment

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

this is to hide output? also just bare export CASSANDRA_PASSWORD

Copy link
Member Author

Choose a reason for hiding this comment

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

also, in another PR.

docker/auto-setup.sh Outdated Show resolved Hide resolved
@alexshtin alexshtin force-pushed the feature/refactor-dockerfile branch from 06ad5d0 to d9b72d8 Compare May 6, 2021 06:47
@alexshtin alexshtin requested a review from a team May 19, 2021 01:13
@alexshtin alexshtin merged commit eff23dc into temporalio:master May 19, 2021
@alexshtin alexshtin deleted the feature/refactor-dockerfile branch May 19, 2021 20:47
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.

None yet

3 participants