Skip to content

Commit

Permalink
Merge pull request #290 from tigrisdata/main
Browse files Browse the repository at this point in the history
Alpha release
  • Loading branch information
efirs authored Jun 10, 2022
2 parents 0cafb54 + 3456318 commit 7cd82ff
Show file tree
Hide file tree
Showing 49 changed files with 1,784 additions and 516 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/go-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ jobs:
- name: Pull build docker images
if: env.need_rebuild
run: |
docker pull debian:bullseye-slim
docker pull golang:1.18-bullseye
docker pull ubuntu:jammy-20220531
- name: Pull submodules
run: git submodule update --init --recursive
Expand All @@ -37,11 +36,14 @@ jobs:
if: env.need_rebuild
run: |
make docker_compose_build
docker image rm debian:bullseye-slim golang:1.18-bullseye
docker image rm ubuntu:jammy-20220531
docker image prune -f
- name: Run tests
run: TEST_PARAM="-coverprofile=coverage.out -covermode=atomic" make docker_test_no_build || ( docker-compose -f test/docker/docker-compose.yml logs && false )
run: make docker_test_no_build || ( docker-compose -f test/docker/docker-compose.yml logs && false )
env:
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/go/bin
TEST_PARAM: "-coverprofile=coverage.out -covermode=atomic"

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
16 changes: 2 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ PROTO_DIR=${API_DIR}/proto/server/${V}
DATA_PROTO_DIR=internal

# Needed to be able to build amd64 binaries on MacOS M1
DOCKER_PLATFORM="linux/amd64"
DOCKER_DIR=test/docker
DOCKER_COMPOSE=COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 DOCKER_DEFAULT_PLATFORM=$(DOCKER_PLATFORM) docker-compose -f ${DOCKER_DIR}/docker-compose.yml
GOARCH="amd64"
DOCKER_COMPOSE=COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose -f ${DOCKER_DIR}/docker-compose.yml
CGO_ENABLED=1

OSX_CLUSTER_FILE="/usr/local/etc/foundationdb/fdb.cluster"

all: server

.PRECIOUS: ${PROTO_DIR}/%_openapi.yaml ${PROTO_DIR}/%.proto
Expand All @@ -38,7 +34,7 @@ generate: ${GEN_DIR}/api.pb.go ${GEN_DIR}/api.pb.gw.go ${GEN_DIR}/health.pb.go $

server: server/service
server/service: $(GO_SRC) generate
GOARCH=$(GOARCH) CGO_ENABLED=$(CGO_ENABLED) go build $(BUILD_PARAM) -o server/service ./server
CGO_ENABLED=$(CGO_ENABLED) go build $(BUILD_PARAM) -o server/service ./server

lint: generate
yq --exit-status 'tag == "!!map" or tag== "!!seq"' .github/workflows/*.yaml config/*.yaml
Expand Down Expand Up @@ -80,13 +76,5 @@ clean:
rm -f server/service api/server/${V}/*.pb.go \
api/server/${V}/*.pb.gw.go \

# OSX specific targets to run tests against FDB installed on the Mac OSX host (non-containerized)
osx_test: generate
TIGRIS_SERVER_FOUNDATIONDB_CLUSTER_FILE=$(OSX_CLUSTER_FILE) GOARCH=$(GOARCH) CGO_ENABLED=$(CGO_ENABLED) go test $(TEST_PARAM) ./...

osx_run: generate server
TIGRIS_SERVER_FOUNDATIONDB_CLUSTER_FILE=$(OSX_CLUSTER_FILE) ./server/service

upgrade_api:
git submodule update --remote --recursive --rebase

20 changes: 0 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,6 @@ The docker volume `fdbdata` is mounted at:
which is the default location where the client will search for the cluster
file

### Building and Testing on Apple M1

Due to various issues with Docker on Apple M1, it is recommended to install
FoundationDB on the host and run the server on the host directly as well.

To run the server on the host, required dependencies need to be installed by
running:

```shell
sh scripts/install_build_deps.sh
sh scripts/install_test_deps.sh
```

Once the dependencies are installed, you can start up the server on the host as
follows:

```shell
make osx_run
```

You can run the test on your local machine as follows:

```shell
Expand Down
21 changes: 15 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,33 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.18-bullseye AS build

RUN apt-get update && apt-get install -y --no-install-recommends apt-transport-https sudo
FROM ubuntu:jammy-20220531 AS build

RUN apt-get update && \
apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gcc \
git \
golang \
make \
sudo

RUN mkdir /build

#Download deps once, during docker build. Rebuild only on go.mod change
ENV PATH="${PATH}:/root/go/bin"
COPY scripts/install_build_deps.sh /build
RUN sh /build/install_build_deps.sh
COPY go.mod /build
WORKDIR /build
RUN go mod download

COPY . /build

RUN --mount=type=cache,target=/root/.cache/go-build rm -f server/service && make bins

FROM debian:bullseye-slim

FROM ubuntu:jammy-20220531 AS server

# Remove apt configuration
RUN rm -rf /etc/apt/*
Expand Down
33 changes: 8 additions & 25 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ require (
github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.2
github.com/hashicorp/go-multierror v1.1.1
github.com/json-iterator/go v1.1.12
github.com/m3db/prometheus_client_golang v1.12.8
github.com/pkg/errors v0.9.1
github.com/rs/zerolog v1.26.1
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0
Expand All @@ -27,6 +28,8 @@ require (
github.com/spf13/viper v1.12.0
github.com/stretchr/testify v1.7.1
github.com/tigrisdata/tigris-client-go v1.0.0-alpha.14
github.com/typesense/typesense-go v0.4.0
github.com/uber-go/tally v3.5.0+incompatible
github.com/ugorji/go/codec v1.2.7
github.com/valyala/bytebufferpool v1.0.0
google.golang.org/genproto v0.0.0-20220526192754-51939a95c655
Expand All @@ -41,39 +44,26 @@ require (
github.com/ajg/form v1.5.1 // indirect
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cilium/ebpf v0.7.0 // indirect
github.com/cosiner/argv v0.1.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/deepmap/oapi-codegen v1.11.0 // indirect
github.com/derekparker/trie v0.0.0-20200317170641-1fdf38b7b0e9 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/gavv/monotime v0.0.0-20190418164738-30dba4353424 // indirect
github.com/gertd/go-pluralize v0.2.0 // indirect
github.com/getkin/kin-openapi v0.94.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-delve/delve v1.8.3 // indirect
github.com/go-delve/liner v1.2.2-1 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/swag v0.21.1 // indirect
github.com/google/go-dap v0.6.0 // indirect
github.com/google/go-querystring v1.0.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/iancoleman/strcase v0.2.0 // indirect
github.com/imkira/go-interpol v1.1.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jhump/protoreflect v1.12.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.15.1 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
github.com/m3db/prometheus_client_model v0.2.1 // indirect
github.com/m3db/prometheus_common v0.34.6 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
Expand All @@ -84,21 +74,15 @@ require (
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/sergi/go-diff v1.0.0 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/sirupsen/logrus v1.6.0 // indirect
github.com/smartystreets/goconvey v1.7.2 // indirect
github.com/sony/gobreaker v0.5.0 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cobra v1.1.3 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.3.0 // indirect
github.com/twmb/murmur3 v1.1.6 // indirect
github.com/valyala/fasthttp v1.34.0 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
Expand All @@ -107,8 +91,7 @@ require (
github.com/yudai/gojsondiff v1.0.0 // indirect
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
github.com/yudai/pp v2.0.1+incompatible // indirect
go.starlark.net v0.0.0-20200821142938-949cc6f4b097 // indirect
golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4 // indirect
go.uber.org/atomic v1.7.0 // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/net v0.0.0-20220526153639-5463443f8c37 // indirect
golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 // indirect
Expand Down
Loading

0 comments on commit 7cd82ff

Please sign in to comment.