Skip to content

Commit

Permalink
Merge branch 'frances/update-vtadmin-vite' of github.com:planetscale/…
Browse files Browse the repository at this point in the history
…vitess-operator into frances/update-vtadmin-vite
  • Loading branch information
notfelineit committed Apr 10, 2023
2 parents 1e97442 + 85ae3ba commit ba42ca9
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ agents:
steps:
- name: "Upgrade Test"
command:
- apk add g++ make bash curl mysql mysql-client
- apk add g++ make bash gcompat curl mysql mysql-client
- wget https://golang.org/dl/go1.19.4.linux-amd64.tar.gz
- tar -C /usr/local -xzf go1.19.4.linux-amd64.tar.gz
- export PATH=$PATH:/usr/local/go/bin
Expand All @@ -24,7 +24,7 @@ steps:

- name: "Backup Restore Test"
command:
- apk add g++ make bash curl mysql mysql-client
- apk add g++ make bash gcompat curl mysql mysql-client
- wget https://golang.org/dl/go1.19.4.linux-amd64.tar.gz
- tar -C /usr/local -xzf go1.19.4.linux-amd64.tar.gz
- export PATH=$PATH:/usr/local/go/bin
Expand All @@ -42,7 +42,7 @@ steps:

- name: "VTOrc and VTAdmin Test"
command:
- apk add g++ make bash curl mysql mysql-client chromium
- apk add g++ make bash gcompat curl mysql mysql-client chromium
- wget https://golang.org/dl/go1.19.4.linux-amd64.tar.gz
- tar -C /usr/local -xzf go1.19.4.linux-amd64.tar.gz
- export PATH=$PATH:/usr/local/go/bin
Expand Down
10 changes: 10 additions & 0 deletions deploy/example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ stringData:
# Equivalent of mysql_secure_installation
###############################################################################
# We need to ensure that super_read_only is disabled so that we can execute
# these commands. Note that disabling it does NOT disable read_only.
# We save the current value so that we only re-enable it at the end if it was
# enabled before.
SET @original_super_read_only=IF(@@global.super_read_only=1, 'ON', 'OFF');
SET GLOBAL super_read_only='OFF';
# Changes during the init db should not make it to the binlog.
# They could potentially create errant transactions on replicas.
SET sql_log_bin = 0;
Expand Down Expand Up @@ -202,3 +209,6 @@ stringData:
RESET SLAVE ALL;
RESET MASTER;
# We need to set super_read_only back to what it was before
SET GLOBAL super_read_only=IFNULL(@original_super_read_only, 'ON');
8 changes: 7 additions & 1 deletion pkg/controller/vitesscluster/reconcile_vtadmin.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,13 @@ func (r *ReconcileVitessCluster) createWebConfigSecret(ctx context.Context, vt *
'VITE_BUGSNAG_API_KEY': "",
'VITE_DOCUMENT_TITLE': "",
'VITE_READONLY_MODE': %s,
};`, apiAddress, convertReadOnlyFieldToString(vt.Spec.VtAdmin.ReadOnly))
'REACT_APP_VTADMIN_API_ADDRESS': "%s",
'REACT_APP_FETCH_CREDENTIALS': "omit",
'REACT_APP_ENABLE_EXPERIMENTAL_TABLET_DEBUG_VARS': false,
'REACT_APP_BUGSNAG_API_KEY': "",
'REACT_APP_DOCUMENT_TITLE': "",
'REACT_APP_READONLY_MODE': %s,
};`, apiAddress, convertReadOnlyFieldToString(vt.Spec.VtAdmin.ReadOnly), apiAddress, convertReadOnlyFieldToString(vt.Spec.VtAdmin.ReadOnly))
secretName := vtadmin.WebConfigSecretName(vt.Name, cell.Name)

// Create or update the secret
Expand Down
14 changes: 14 additions & 0 deletions runrunrun.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

for i in {1..500} ; do
docker run -it --rm --init --volume $PWD:/workdir --env BUILDKITE_BUILD_ID=$i --volume /var/run/docker.sock:/var/run/docker.sock --workdir /workdir docker:23.0.0 /bin/sh -e -c $'apk add g++ make bash gcompat curl mysql mysql-client\nwget https://golang.org/dl/go1.19.4.linux-amd64.tar.gz\ntar -C /usr/local -xzf go1.19.4.linux-amd64.tar.gz\nrm go1.19.4.linux-amd64.tar.gz\nexport PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/bin:/usr/local/go/bin && make upgrade-test'
if [ $? -eq 0 ]; then
echo "Attempt #$i success" >> runrunrun_log.txt
docker container stop kind-$i-control-plane
docker container rm kind-$i-control-plane
else
echo "========================" >> runrunrun_log.txt
echo "Attempt #$i failed" >> runrunrun_log.txt
fi
done

12 changes: 11 additions & 1 deletion test/endtoend/operator/101_initial_cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ spec:
mysqld:
resources:
limits:
memory: 512Mi
memory: 1024Mi
requests:
cpu: 100m
memory: 512Mi
Expand Down Expand Up @@ -113,6 +113,13 @@ stringData:
# Equivalent of mysql_secure_installation
###############################################################################
# We need to ensure that super_read_only is disabled so that we can execute
# these commands. Note that disabling it does NOT disable read_only.
# We save the current value so that we only re-enable it at the end if it was
# enabled before.
SET @original_super_read_only=IF(@@global.super_read_only=1, 'ON', 'OFF');
SET GLOBAL super_read_only='OFF';
# Changes during the init db should not make it to the binlog.
# They could potentially create errant transactions on replicas.
SET sql_log_bin = 0;
Expand Down Expand Up @@ -197,3 +204,6 @@ stringData:
RESET SLAVE ALL;
RESET MASTER;
# We need to set super_read_only back to what it was before
SET GLOBAL super_read_only=IFNULL(@original_super_read_only, 'ON');
12 changes: 11 additions & 1 deletion test/endtoend/operator/101_initial_cluster_backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ spec:
mysqld:
resources:
limits:
memory: 512Mi
memory: 1024Mi
requests:
cpu: 100m
memory: 512Mi
Expand Down Expand Up @@ -120,6 +120,13 @@ stringData:
# Equivalent of mysql_secure_installation
###############################################################################
# We need to ensure that super_read_only is disabled so that we can execute
# these commands. Note that disabling it does NOT disable read_only.
# We save the current value so that we only re-enable it at the end if it was
# enabled before.
SET @original_super_read_only=IF(@@global.super_read_only=1, 'ON', 'OFF');
SET GLOBAL super_read_only='OFF';
# Changes during the init db should not make it to the binlog.
# They could potentially create errant transactions on replicas.
SET sql_log_bin = 0;
Expand Down Expand Up @@ -204,3 +211,6 @@ stringData:
RESET SLAVE ALL;
RESET MASTER;
# We need to set super_read_only back to what it was before
SET GLOBAL super_read_only=IFNULL(@original_super_read_only, 'ON');
12 changes: 11 additions & 1 deletion test/endtoend/operator/101_initial_cluster_vtorc_vtadmin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ spec:
mysqld:
resources:
limits:
memory: 512Mi
memory: 1024Mi
requests:
cpu: 100m
memory: 512Mi
Expand Down Expand Up @@ -128,6 +128,13 @@ stringData:
# Equivalent of mysql_secure_installation
###############################################################################
# We need to ensure that super_read_only is disabled so that we can execute
# these commands. Note that disabling it does NOT disable read_only.
# We save the current value so that we only re-enable it at the end if it was
# enabled before.
SET @original_super_read_only=IF(@@global.super_read_only=1, 'ON', 'OFF');
SET GLOBAL super_read_only='OFF';
# Changes during the init db should not make it to the binlog.
# They could potentially create errant transactions on replicas.
SET sql_log_bin = 0;
Expand Down Expand Up @@ -212,6 +219,9 @@ stringData:
RESET SLAVE ALL;
RESET MASTER;
# We need to set super_read_only back to what it was before
SET GLOBAL super_read_only=IFNULL(@original_super_read_only, 'ON');
rbac.yaml: |
rules:
- resource: "*"
Expand Down
4 changes: 2 additions & 2 deletions test/endtoend/operator/201_customer_tablets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ spec:
mysqld:
resources:
limits:
memory: 512Mi
memory: 1024Mi
requests:
cpu: 100m
memory: 512Mi
Expand Down Expand Up @@ -120,7 +120,7 @@ spec:
mysqld:
resources:
limits:
memory: 512Mi
memory: 1024Mi
requests:
cpu: 100m
memory: 512Mi
Expand Down
6 changes: 3 additions & 3 deletions test/endtoend/operator/302_new_shards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ spec:
mysqld:
resources:
limits:
memory: 512Mi
memory: 1024Mi
requests:
cpu: 100m
memory: 512Mi
Expand Down Expand Up @@ -120,7 +120,7 @@ spec:
mysqld:
resources:
limits:
memory: 512Mi
memory: 1024Mi
requests:
cpu: 100m
memory: 512Mi
Expand Down Expand Up @@ -151,7 +151,7 @@ spec:
mysqld:
resources:
limits:
memory: 512Mi
memory: 1024Mi
requests:
cpu: 100m
memory: 512Mi
Expand Down
2 changes: 1 addition & 1 deletion test/endtoend/operator/cluster_upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ spec:
mysqld:
resources:
limits:
memory: 512Mi
memory: 1024Mi
requests:
cpu: 100m
memory: 512Mi
Expand Down

0 comments on commit ba42ca9

Please sign in to comment.