Skip to content

Commit

Permalink
Remove MYSQL_FLAVOR from all Docker images (#14159)
Browse files Browse the repository at this point in the history
  • Loading branch information
frouioui authored Oct 3, 2023
1 parent d928738 commit 2f1fc13
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 29 deletions.
13 changes: 13 additions & 0 deletions changelog/19.0/19.0.0/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Summary

### Table of Contents

- **[Major Changes](#major-changes)**
- **[Deprecations and Deletions](#deprecations-and-deletions)**


## <a id="major-changes"/>Major Changes

### <a id="deprecations-and-deletions"/>Deprecations and Deletions

- The `MYSQL_FLAVOR` environment variable is now removed from all Docker Images.
2 changes: 2 additions & 0 deletions changelog/19.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## v19.0
* **[19.0.0](19.0.0)**
1 change: 1 addition & 0 deletions changelog/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Releases
* [19.0](19.0)
* [18.0](18.0)
* [17.0](17.0)
* [16.0](16.0)
Expand Down
1 change: 0 additions & 1 deletion docker/bootstrap/Dockerfile.mysql80
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ RUN for i in $(seq 1 10); do apt-key adv --no-tty --recv-keys --keyserver keyser
# Bootstrap Vitess
WORKDIR /vt/src/vitess.io/vitess

ENV MYSQL_FLAVOR MySQL80
USER vitess
RUN ./bootstrap.sh
1 change: 0 additions & 1 deletion docker/bootstrap/Dockerfile.percona80
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,5 @@ RUN for i in $(seq 1 10); do apt-key adv --no-tty --keyserver keyserver.ubuntu.c
# Bootstrap Vitess
WORKDIR /vt/src/vitess.io/vitess

ENV MYSQL_FLAVOR MySQL80
USER vitess
RUN ./bootstrap.sh
1 change: 0 additions & 1 deletion docker/lite/Dockerfile.mysql80
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ RUN mkdir -p /vt/vtdataroot && chown -R vitess:vitess /vt
ENV VTROOT /vt/src/vitess.io/vitess
ENV VTDATAROOT /vt/vtdataroot
ENV PATH $VTROOT/bin:$PATH
ENV MYSQL_FLAVOR MySQL80

# Copy artifacts from builder layer.
COPY --from=builder --chown=vitess:vitess /vt/install /vt
Expand Down
1 change: 0 additions & 1 deletion docker/lite/Dockerfile.percona80
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ RUN mkdir -p /vt/vtdataroot && chown -R vitess:vitess /vt
ENV VTROOT /vt/src/vitess.io/vitess
ENV VTDATAROOT /vt/vtdataroot
ENV PATH $VTROOT/bin:$PATH
ENV MYSQL_FLAVOR MySQL80

# Copy artifacts from builder layer.
COPY --from=builder --chown=vitess:vitess /vt/install /vt
Expand Down
1 change: 0 additions & 1 deletion docker/lite/Dockerfile.ubi7.mysql80
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ RUN mkdir -p /vt/vtdataroot && chown -R vitess:vitess /vt
ENV VTROOT /vt/src/vitess.io/vitess
ENV VTDATAROOT /vt/vtdataroot
ENV PATH $VTROOT/bin:$PATH
ENV MYSQL_FLAVOR MySQL80

# Copy artifacts from builder layer.
COPY --from=builder --chown=vitess:vitess /vt/install /vt
Expand Down
1 change: 0 additions & 1 deletion docker/lite/Dockerfile.ubi7.percona80
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ RUN mkdir -p /vt/vtdataroot && chown -R vitess:vitess /vt
ENV VTROOT /vt/src/vitess.io/vitess
ENV VTDATAROOT /vt/vtdataroot
ENV PATH $VTROOT/bin:$PATH
ENV MYSQL_FLAVOR MySQL80

# Copy artifacts from builder layer.
COPY --from=builder --chown=vitess:vitess /vt/install /vt
Expand Down
1 change: 0 additions & 1 deletion docker/lite/Dockerfile.ubi8.arm64.mysql80
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ RUN mkdir -p /vt/vtdataroot && chown -R vitess:vitess /vt
ENV VTROOT /vt/src/vitess.io/vitess
ENV VTDATAROOT /vt/vtdataroot
ENV PATH $VTROOT/bin:$PATH
ENV MYSQL_FLAVOR MySQL80

# Copy artifacts from builder layer.
COPY --from=builder --chown=vitess:vitess /vt/install /vt
Expand Down
1 change: 0 additions & 1 deletion docker/lite/Dockerfile.ubi8.mysql80
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ RUN mkdir -p /vt/vtdataroot && chown -R vitess:vitess /vt
ENV VTROOT /vt/src/vitess.io/vitess
ENV VTDATAROOT /vt/vtdataroot
ENV PATH $VTROOT/bin:$PATH
ENV MYSQL_FLAVOR MySQL80

# Copy artifacts from builder layer.
COPY --from=builder --chown=vitess:vitess /vt/install /vt
Expand Down
2 changes: 1 addition & 1 deletion examples/demo/demo.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func runCluster() {
VSchemaDDLAuthorizedUsers: "%",
},
}
env, err := vttest.NewLocalTestEnv("", 12345)
env, err := vttest.NewLocalTestEnv(12345)
if err != nil {
log.Exitf("Error: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions go/cmd/vttestserver/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,12 @@ func New() (cmd *cobra.Command) {
func newEnv() (env vttest.Environment, err error) {
if basePort != 0 {
if config.DataDir == "" {
env, err = vttest.NewLocalTestEnv("", basePort)
env, err = vttest.NewLocalTestEnv(basePort)
if err != nil {
return
}
} else {
env, err = vttest.NewLocalTestEnvWithDirectory("", basePort, config.DataDir)
env, err = vttest.NewLocalTestEnvWithDirectory(basePort, config.DataDir)
if err != nil {
return
}
Expand Down
2 changes: 1 addition & 1 deletion go/vt/vttablet/endtoend/streamtimeout/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestMain(m *testing.M) {
Charset: "utf8mb4_general_ci",
}

env, err := vttest.NewLocalTestEnv("", 0)
env, err := vttest.NewLocalTestEnv(0)
if err != nil {
fmt.Fprintf(os.Stderr, "%v", err)
return 1
Expand Down
25 changes: 8 additions & 17 deletions go/vt/vttest/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,24 +107,16 @@ type LocalTestEnv struct {
// flavor is given.
const DefaultMySQLFlavor = "MySQL56"

// GetMySQLOptions returns the default option set for the given MySQL
// flavor. If flavor is not set, DefaultMySQLFlavor will
// be used.
// Returns the name of the MySQL flavor being used, the set of MySQL CNF
// files specific to this flavor, and any errors.
func GetMySQLOptions(flavor string) (string, []string, error) {
if flavor == "" {
flavor = DefaultMySQLFlavor
}

// GetMySQLOptions returns the set of MySQL CNF files and any errors.
func GetMySQLOptions() ([]string, error) {
mycnf := []string{}
mycnf = append(mycnf, "config/mycnf/test-suite.cnf")

for i, cnf := range mycnf {
mycnf[i] = path.Join(os.Getenv("VTROOT"), cnf)
}

return flavor, mycnf, nil
return mycnf, nil
}

// EnvVars implements EnvVars for LocalTestEnv
Expand Down Expand Up @@ -258,25 +250,25 @@ func randomPort() int {
// - MySQLManager() will return a vttest.Mysqlctl instance, configured with the
// given MySQL flavor. This will use the `mysqlctl` command to initialize and
// teardown a single mysqld instance.
func NewLocalTestEnv(flavor string, basePort int) (*LocalTestEnv, error) {
func NewLocalTestEnv(basePort int) (*LocalTestEnv, error) {
directory, err := tmpdir(os.Getenv("VTDATAROOT"))
if err != nil {
return nil, err
}
return NewLocalTestEnvWithDirectory(flavor, basePort, directory)
return NewLocalTestEnvWithDirectory(basePort, directory)
}

// NewLocalTestEnvWithDirectory returns a new instance of the default test
// environment with a directory explicitly specified.
func NewLocalTestEnvWithDirectory(flavor string, basePort int, directory string) (*LocalTestEnv, error) {
func NewLocalTestEnvWithDirectory(basePort int, directory string) (*LocalTestEnv, error) {
if _, err := os.Stat(path.Join(directory, "logs")); os.IsNotExist(err) {
err := os.Mkdir(path.Join(directory, "logs"), 0700)
if err != nil {
return nil, err
}
}

flavor, mycnf, err := GetMySQLOptions(flavor)
mycnf, err := GetMySQLOptions()
if err != nil {
return nil, err
}
Expand All @@ -291,14 +283,13 @@ func NewLocalTestEnvWithDirectory(flavor string, basePort int, directory string)
DefaultMyCnf: mycnf,
Env: []string{
fmt.Sprintf("VTDATAROOT=%s", directory),
fmt.Sprintf("MYSQL_FLAVOR=%s", flavor),
"VTTEST=endtoend",
},
}, nil
}

func defaultEnvFactory() (Environment, error) {
return NewLocalTestEnv("", 0)
return NewLocalTestEnv(0)
}

// NewDefaultEnv is an user-configurable callback that returns a new Environment
Expand Down

0 comments on commit 2f1fc13

Please sign in to comment.