Skip to content

Commit

Permalink
merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
kingster committed Sep 6, 2022
1 parent 514070a commit 86ab703
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 29 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Build Docker Image
uses: docker/build-push-action@v3
with:
push: ${{ github.event_name != 'pull_request' }}
push: true # ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# platforms: linux/amd64,linux/arm64
Expand All @@ -71,7 +71,6 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
build-args: |
BASE=ubuntu:20.04
GIT_SHA=${{ steps.sha_extract.outputs.sha }}
- name: Move cache
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
build-args: |
BASE=ubuntu:20.04
CI=true
- name: Run tests
run: |
Expand Down
39 changes: 14 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,42 +1,31 @@
ARG BASE=ubuntu:20.04
FROM $BASE
FROM golang:1.18-alpine

LABEL maintainer="DKV Developers ([email protected])"

RUN apt-get update && \
# Install basic utilities
apt-get install --yes --allow-unauthenticated adduser vim sudo git curl unzip build-essential \
# Install Compression libs
zlib1g-dev libbz2-dev libsnappy-dev liblz4-dev && \
# Cleanup
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >>/etc/apk/repositories

# Install ZStandard lib
RUN curl -fsSL https://github.com/facebook/zstd/releases/download/v1.4.4/zstd-1.4.4.tar.gz | tar xz \
&& cd zstd-1.4.4 && make install
# Build tools
RUN apk add --update --no-cache linux-headers git make cmake gcc g++ musl musl-dev binutils autoconf automake libtool pkgconfig check-dev file patch bash curl dpkg nano

# Install RocksDB v6.5.3
RUN curl -fsSL https://github.com/facebook/rocksdb/archive/v6.22.1.tar.gz | tar xz \
&& cd rocksdb-6.22.1 && make install
# Dependencies
RUN apk add --update --no-cache zlib zlib-dev zlib-static bzip2 bzip2-dev bzip2-static snappy snappy-dev snappy-static lz4 lz4-dev lz4-static gflags-dev zstd zstd-dev zstd-static

# Install GoLang
RUN curl -fsSL https://dl.google.com/go/go1.18.1.linux-$(dpkg --print-architecture).tar.gz | tar xz \
&& chown -R root:root ./go && mv ./go /usr/local
ENV PATH="/usr/local/go/bin:${PATH}"
# Install RocksDB
RUN git clone --branch v6.22.1 --depth 1 https://github.com/facebook/rocksdb.git && \
cd rocksdb && \
# Fix 'install -c' flag
sed -i 's/install -C/install -c/g' Makefile && \
make -j4 static_lib && make install-static

# Install Protobuf
#RUN curl -fsSL -o protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.15.8/protoc-3.15.8-linux-x86_64.zip \
# && unzip protoc.zip -d protoc && chown -R root:root ./protoc && mv ./protoc /usr/local && rm protoc.zip
#ENV PATH="/usr/local/protoc/bin:${PATH}"
ENV LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"

# Install DKV (Skipped for CI Pipelines)
ARG CI
ARG GIT_SHA=master
RUN if [ -z "$CI" ] ; then git clone https://github.com/flipkart-incubator/dkv.git \
&& cd dkv && git checkout $GIT_SHA && GOOS=linux GOARCH=$(dpkg --print-architecture) make build \
&& cd dkv && git checkout $GIT_SHA && GOOS=linux GOARCH=$(dpkg --print-architecture | awk -F'-' '{print $NF}') make build \
&& mv ./bin /usr/local/dkv && chown -R root:root /usr/local/dkv; fi

ENV PATH="/usr/local/dkv:${PATH}"
ENV LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"

CMD ["dkvsrv"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ifeq ($(VERSION),)
endif

BUILD_TAGS = 'osusergo netgo static_build'
ALDFLAGS = -ldflags '-linkmode external -extldflags "-static" -X "github.com/flipkart-incubator/dkv/version.Version=$(VERSION)"'
ALDFLAGS = -ldflags '-linkmode external -extldflags -static -X "github.com/flipkart-incubator/dkv/version.Version=$(VERSION)"'

ifeq ($(GOOS),darwin)
ALDFLAGS = -ldflags '-X "github.com/flipkart-incubator/dkv/version.Version=$(VERSION)"'
Expand Down

0 comments on commit 86ab703

Please sign in to comment.