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

Allow custom image tags in compose #7043

Merged
merged 5 commits into from
Nov 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions examples/compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,13 @@ To run against a specific compose service/container, use the environment variabl
vitess/examples/compose$ (export CS=vttablet101; ./lvtctl.sh <args> )
```

## Custom Image Tags
You may specify a custom `vitess:lite` image tag by setting the evnironment variable `VITESS_TAG`.
This is optional and defaults to the `latest` tag. Example;
* Set `VITESS_TAG=8.0.0` in your `.env` before running `docker-compose up -d`
* Run `VITESS_TAG=8.0.0; docker-compose up -d`


## Reference
Checkout this excellent post about [The Life of a Vitess Cluster](https://vitess.io/blog/2020-04-27-life-of-a-cluster/)

Expand Down
18 changes: 9 additions & 9 deletions examples/compose/docker-compose.beginners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ services:
- "3306"

vtctld:
image: vitess/lite
image: vitess/lite:${VITESS_TAG:-latest}
ports:
- "15000:$WEB_PORT"
- "$GRPC_PORT"
Expand All @@ -83,7 +83,7 @@ services:
condition: service_healthy

vtgate:
image: vitess/lite
image: vitess/lite:${VITESS_TAG:-latest}
ports:
- "15099:$WEB_PORT"
- "$GRPC_PORT"
Expand Down Expand Up @@ -113,7 +113,7 @@ services:
condition: service_healthy

schemaload:
image: vitess/lite
image: vitess/lite:${VITESS_TAG:-latest}
command:
- sh
- -c
Expand All @@ -137,7 +137,7 @@ services:
condition: service_healthy

vttablet100:
image: vitess/lite
image: vitess/lite:${VITESS_TAG:-latest}
ports:
- "15100:$WEB_PORT"
- "$GRPC_PORT"
Expand Down Expand Up @@ -169,7 +169,7 @@ services:
retries: 15

vttablet101:
image: vitess/lite
image: vitess/lite:${VITESS_TAG:-latest}
ports:
- "15101:$WEB_PORT"
- "$GRPC_PORT"
Expand Down Expand Up @@ -201,7 +201,7 @@ services:
retries: 15

vttablet102:
image: vitess/lite
image: vitess/lite:${VITESS_TAG:-latest}
ports:
- "15102:$WEB_PORT"
- "$GRPC_PORT"
Expand Down Expand Up @@ -233,7 +233,7 @@ services:
retries: 15

vttablet103:
image: vitess/lite
image: vitess/lite:${VITESS_TAG:-latest}
ports:
- "15103:$WEB_PORT"
- "$GRPC_PORT"
Expand Down Expand Up @@ -265,7 +265,7 @@ services:
retries: 15

vtorc:
image: vitess/lite
image: vitess/lite:${VITESS_TAG:-latest}
command: ["sh", "-c", "/script/vtorc-up.sh"]
depends_on:
- vtctld
Expand Down Expand Up @@ -293,7 +293,7 @@ services:
retries: 15

vreplication:
image: vitess/lite
image: vitess/lite:${VITESS_TAG:-latest}
volumes:
- ".:/script"
environment:
Expand Down
24 changes: 24 additions & 0 deletions examples/compose/tablet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
externalConnections:
erpl:
flavor: FilePos
host: external_db_host
port: 3306
dbName: commerce
app:
user: external_db_user
password: external_db_password
dba:
user: external_db_user
password: external_db_password
filtered:
user: external_db_user
password: external_db_password
repl:
user: external_db_user
password: external_db_password
appdebug:
user: external_db_user
password: external_db_password
allprivs:
user: external_db_user
password: external_db_password
18 changes: 9 additions & 9 deletions examples/compose/vtcompose/vtcompose.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ func generateDefaultShard(tabAlias int, shard string, keyspaceData keyspaceInfo,
- op: add
path: /services/init_shard_master%[2]d
value:
image: vitess/lite
image: vitess/lite:${VITESS_TAG:-latest}
command: ["sh", "-c", "/vt/bin/vtctlclient %[5]s InitShardMaster -force %[4]s/%[3]s %[6]s-%[2]d "]
%[1]s
`, dependsOn, aliases[0], shard, keyspaceData.keyspace, opts.topologyFlags, opts.cell)
Expand Down Expand Up @@ -564,7 +564,7 @@ func generateExternalmaster(
- op: add
path: /services/vttablet%[1]d
value:
image: vitess/lite
image: vitess/lite:${VITESS_TAG:-latest}
ports:
- "15%[1]d:%[3]d"
- "%[4]d"
Expand Down Expand Up @@ -626,7 +626,7 @@ func generateDefaultTablet(tabAlias int, shard, role, keyspace string, dbInfo ex
- op: add
path: /services/vttablet%[1]d
value:
image: vitess/lite
image: vitess/lite:${VITESS_TAG:-latest}
ports:
- "15%[1]d:%[4]d"
- "%[5]d"
Expand Down Expand Up @@ -664,7 +664,7 @@ func generateVtctld(opts vtOptions) string {
- op: add
path: /services/vtctld
value:
image: vitess/lite
image: vitess/lite:${VITESS_TAG:-latest}
ports:
- "15000:%[1]d"
- "%[2]d"
Expand Down Expand Up @@ -697,7 +697,7 @@ func generateVtgate(opts vtOptions) string {
- op: add
path: /services/vtgate
value:
image: vitess/lite
image: vitess/lite:${VITESS_TAG:-latest}
ports:
- "15099:%[1]d"
- "%[2]d"
Expand Down Expand Up @@ -727,7 +727,7 @@ func generateVtwork(opts vtOptions) string {
- op: add
path: /services/vtwork
value:
image: vitess/lite
image: vitess/lite:${VITESS_TAG:-latest}
ports:
- "%[1]d"
- "%[2]d"
Expand All @@ -754,7 +754,7 @@ func generateVtorc(dbInfo externalDbInfo, opts vtOptions) string {
- op: add
path: /services/vtorc
value:
image: vitess/lite
image: vitess/lite:${VITESS_TAG:-latest}
volumes:
- ".:/script"
environment:
Expand All @@ -779,7 +779,7 @@ func generateVreplication(dbInfo externalDbInfo, opts vtOptions) string {
- op: add
path: /services/vreplication
value:
image: vitess/lite
image: vitess/lite:${VITESS_TAG:-latest}
volumes:
- ".:/script"
environment:
Expand Down Expand Up @@ -817,7 +817,7 @@ func generateSchemaload(
- op: add
path: /services/schemaload_%[7]s
value:
image: vitess/lite
image: vitess/lite:${VITESS_TAG:-latest}
volumes:
- ".:/script"
environment:
Expand Down
1 change: 0 additions & 1 deletion examples/compose/vttablet-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ if [ $tablet_role = "externalmaster" ]; then
-db_filtered_password $DB_PASS \
-db_repl_user $DB_USER \
-db_repl_password $DB_PASS \
-init_populate_metadata=true \
-enable_replication_reporter=false \
-enforce_strict_trans_tables=false \
-track_schema_versions=true \
Expand Down