-
Notifications
You must be signed in to change notification settings - Fork 45
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 #325 from tigrisdata/main
Releasing Server
- Loading branch information
Showing
26 changed files
with
1,088 additions
and
153 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: publish local docker image | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- alpha | ||
release: | ||
types: [published] | ||
workflow_call: | ||
secrets: | ||
GH_DOCKER_ACCESS_USER: | ||
required: true | ||
GH_DOCKER_ACCESS_TOKEN: | ||
required: true | ||
|
||
env: | ||
DOCKER_REPOSITORY: "tigrisdata/tigris-local" | ||
|
||
jobs: | ||
build-and-push-local-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Fetch tags | ||
run: | | ||
git fetch --prune --unshallow --tags | ||
- name: Login to Docker Hub | ||
id: login-docker-hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.GH_DOCKER_ACCESS_USER }} | ||
password: ${{ secrets.GH_DOCKER_ACCESS_TOKEN }} | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
# list of Docker images to use as base name for tags | ||
images: | | ||
${{ env.DOCKER_REPOSITORY }} | ||
# generate Docker tags based on the following events/attributes | ||
# we generate the latest tag off the alpha branch | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/alpha' }} | ||
- name: Pull submodules | ||
run: git submodule update --init --recursive | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Build and push Docker images | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: docker/Dockerfile.local | ||
platforms: linux/amd64,linux/arm64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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
Submodule proto
updated
from f910e0 to 2d7f25
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,85 @@ | ||
# Copyright 2022 Tigris Data, Inc. | ||
# | ||
# 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. | ||
|
||
FROM ubuntu:20.04 AS build | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
apt-transport-https \ | ||
ca-certificates \ | ||
curl \ | ||
wget \ | ||
gcc \ | ||
git \ | ||
make \ | ||
sudo | ||
|
||
RUN mkdir /build | ||
|
||
COPY scripts/install_go.sh /build | ||
RUN sh /build/install_go.sh | ||
#Download deps once, during docker build. Rebuild only on go.mod change | ||
ENV PATH="${PATH}:/root/go/bin:/usr/local/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 ubuntu:20.04 AS server | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
curl \ | ||
tree | ||
|
||
COPY scripts/install_local_docker_deps.sh /tmp/ | ||
RUN /bin/bash /tmp/install_local_docker_deps.sh && rm /tmp/install_local_docker_deps.sh | ||
|
||
# Remove apt configuration | ||
RUN rm -rf /etc/apt/* /var/lib/dpkg/* /var/lib/apt/* | ||
|
||
# Setup an unprivileged user | ||
RUN groupadd -r tigris && useradd -r -s /bin/false -g tigris tigris | ||
|
||
RUN mkdir -p /server /etc/tigrisdata/tigris /etc/foundationdb /var/lib/foundationdb/logs | ||
|
||
COPY --from=build /build/server/service /server/service | ||
COPY --from=build /build/config/server.yaml /etc/tigrisdata/tigris | ||
COPY --from=build /usr/lib/libfdb_c.so /usr/lib/libfdb_c.so | ||
COPY --from=build /usr/bin/fdbcli /usr/bin/fdbcli | ||
|
||
RUN chown -R tigris:tigris /server /etc/tigrisdata/tigris | ||
|
||
#RUN echo "docker:[email protected]:4500" >/etc/foundationdb/fdb.cluster | ||
RUN echo "#!/bin/bash\n \ | ||
/usr/bin/typesense-server --config=/etc/typesense/typesense-server.ini & \n \ | ||
fdbserver --listen-address 127.0.0.1:4500 --public-address 127.0.0.1:4500 --datadir /var/lib/foundationdb/data --logdir /var/lib/foundationdb/logs --locality-zoneid tigris --locality-machineid tigris & \n\ | ||
export TIGRIS_SERVER_SEARCH_AUTH_KEY=ts_dev_key \n \ | ||
export TIGRIS_SERVER_SEARCH_HOST=localhost \n \ | ||
fdbcli --exec 'configure new single memory' \n \ | ||
/server/service\n" >/server/service.sh | ||
|
||
EXPOSE 8081 | ||
|
||
WORKDIR /server | ||
|
||
# Set the default effective user to an unprivileged user | ||
#USER tigris | ||
|
||
CMD ["/bin/bash", "/server/service.sh"] |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.