forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from github/20200729
2020-07-29 Update of code
- Loading branch information
Showing
560 changed files
with
31,914 additions
and
19,655 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: golangci-lint | ||
on: [push,pull_request] | ||
jobs: | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up Go 1.13 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
|
||
- name: Install golangci-lint | ||
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.27.0 | ||
|
||
- name: Run golangci-lint | ||
run: $(go env GOPATH)/bin/golangci-lint run --disable=errcheck --timeout=10m go/... |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM vitess/bootstrap:common | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y sudo curl vim jq mysql-server | ||
|
||
COPY docker/local/install_local_dependencies.sh /vt/dist/install_local_dependencies.sh | ||
RUN /vt/dist/install_local_dependencies.sh | ||
RUN echo "source /vt/local/env.sh" >> /etc/bash.bashrc | ||
|
||
# Allows some docker builds to disable CGO | ||
ARG CGO_ENABLED=0 | ||
|
||
# Re-copy sources from working tree. | ||
COPY --chown=vitess:vitess . /vt/src/vitess.io/vitess | ||
|
||
# Build and install Vitess in a temporary output directory. | ||
USER vitess | ||
|
||
WORKDIR /vt/src/vitess.io/vitess | ||
RUN make install PREFIX=/vt/install | ||
|
||
ENV VTROOT /vt/src/vitess.io/vitess | ||
ENV VTDATAROOT /vt/vtdataroot | ||
ENV PATH $VTROOT/bin:$PATH | ||
ENV PATH="/var/opt/etcd:${PATH}" | ||
|
||
RUN mkdir /vt/local | ||
COPY examples/local /vt/local | ||
|
||
CMD cd /vt/local && ./101_initial_cluster.sh && /bin/bash |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# This is a script that gets run as part of the Dockerfile build | ||
# to install dependencies for the vitess/mini image. | ||
# | ||
# Usage: install_mini_dependencies.sh | ||
|
||
set -euo pipefail | ||
|
||
# Install etcd | ||
ETCD_VER=v3.4.9 | ||
DOWNLOAD_URL=https://storage.googleapis.com/etcd | ||
|
||
curl -k -L ${DOWNLOAD_URL}/${ETCD_VER}/etcd-${ETCD_VER}-linux-amd64.tar.gz -o /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz | ||
mkdir -p /var/opt/etcd | ||
sudo tar xzvf /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz -C /var/opt/etcd --strip-components=1 | ||
rm -f /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz | ||
|
||
mkdir -p /var/run/etcd && chown -R vitess:vitess /var/run/etcd | ||
|
||
# Clean up files we won't need in the final image. | ||
rm -rf /var/lib/apt/lists/* |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
docker run -p 15000:15000 -p 15001:15001 --rm -it vitess/local |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Copyright 2019 The Vitess Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# NOTE: We have to build the Vitess binaries from scratch instead of sharing | ||
# a base image because Docker Hub dropped the feature we relied upon to | ||
# ensure images contain the right binaries. | ||
|
||
# Use a temporary layer for the build stage. | ||
FROM vitess/base AS base | ||
|
||
FROM vitess/lite | ||
|
||
USER root | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y sudo curl vim python3 jq sqlite3 | ||
RUN ln -s /usr/bin/python3 /usr/bin/python | ||
|
||
# Install minivitess dependencies | ||
COPY docker/mini/install_mini_dependencies.sh /vt/dist/install_mini_dependencies.sh | ||
RUN /vt/dist/install_mini_dependencies.sh | ||
|
||
COPY docker/mini/orchestrator-vitess-mini.conf.json /etc/orchestrator.conf.json | ||
RUN chown vitess:vitess /etc/orchestrator.conf.json | ||
|
||
COPY docker/mini/docker-entry /vt/dist/docker/mini/docker-entry | ||
COPY examples/local/scripts /vt/dist/scripts | ||
COPY examples/local/env.sh /vt/dist/scripts/env.sh | ||
COPY docker/mini/vtctld-mini-up.sh /vt/dist/scripts/vtctld-mini-up.sh | ||
COPY docker/mini/vttablet-mini-up.sh /vt/dist/scripts/vttablet-mini-up.sh | ||
COPY docker/mini/orchestrator-up.sh /vt/dist/scripts/orchestrator-up.sh | ||
RUN echo "hostname=127.0.0.1" >> /vt/dist/scripts/env.sh | ||
RUN cat /vt/dist/scripts/env.sh | egrep "^alias" >> /etc/bash.bashrc | ||
|
||
COPY --from=base /vt/bin/vtctl /vt/bin/ | ||
COPY --from=base /vt/bin/mysqlctl /vt/bin/ | ||
|
||
# Set up Vitess environment (just enough to run pre-built Go binaries) | ||
ENV VTROOT /vt/src/vitess.io/vitess | ||
ENV VTDATAROOT /vt/vtdataroot | ||
ENV PATH $VTROOT/bin:$PATH | ||
ENV PATH="/vt/bin:${PATH}" | ||
ENV PATH="/var/opt/etcd:${PATH}" | ||
ENV TOPO="etcd" | ||
|
||
# Create mount point for actual data (e.g. MySQL data dir) | ||
VOLUME /vt/vtdataroot | ||
USER vitess | ||
EXPOSE 15000-15200 16000-16200 | ||
CMD /vt/dist/docker/mini/docker-entry && /bin/bash |
Oops, something went wrong.