Skip to content

Commit

Permalink
Add golang (#118)
Browse files Browse the repository at this point in the history
* Update pull_request.yml

* Update pull_request.yml

* add golang

* add libstdc++

* Update build.yml
  • Loading branch information
Shinji-IkariG authored Jan 11, 2024
1 parent 03b5745 commit 1fef037
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'master'

concurrency:
group: ${{ github.head_ref }}
group: ${{ github.ref }}
cancel-in-progress: true

defaults:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* jemalloc
* ldap
* libcurl
* libdwarf
* libevent
* libunwind
* lz4
Expand Down Expand Up @@ -86,7 +87,7 @@ The docker-based build is for building pre-built packages of third parties. For
```shell
# Print all targets
$ make -C $path/build print
centos-7 centos-8 ubuntu-1604 ubuntu-1804 ubuntu-2004 ubuntu-2110 ubuntu-2204
centos-7 centos-8 rockylinux-8 ubuntu-1604 ubuntu-1804 ubuntu-2004 ubuntu-2204

# Build specific target
$ make -C $path/build centos-7
Expand Down
7 changes: 3 additions & 4 deletions build/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
arch=$(shell uname -m)
tags=centos-7 centos-8 ubuntu-1604 ubuntu-1804 ubuntu-2004 ubuntu-2110 ubuntu-2204
tags=centos-7 centos-8 rockylinux-8 ubuntu-1604 ubuntu-1804 ubuntu-2004 ubuntu-2204

all: $(tags)

Expand All @@ -21,5 +20,5 @@ ifneq ($(USE_GCC_VERSIONS),)
endif

%:
@echo '******************' Build Nebula Third Party For $*-$(arch) '********************'
@$(docker_cmd) --rm -it vesoft/third-party-build:$*-$(arch) ./run.sh
@echo '******************' Build Nebula Third Party For $* '********************'
@$(docker_cmd) --rm -it vesoft/third-party-build:$* ./run.sh
11 changes: 5 additions & 6 deletions docker/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
arch=$(shell uname -m)
tags=centos-7 centos-8 ubuntu-1604 ubuntu-1804 ubuntu-2004 ubuntu-2010
tags=centos-7 centos-8 rockylinux-8 ubuntu-1604 ubuntu-1804 ubuntu-2004 ubuntu-2204

all: $(tags)
.PHONY: all

print:
@echo $(tags)

build-%: $(arch)/%.Dockerfile
build-%: buildx/%.Dockerfile
@echo '******************' Build Nebula Third Party Docker For $*-$(arch) '********************'
@docker build --no-cache -t vesoft/third-party-build:$*-$(arch) -f $(arch)/$*.Dockerfile .
@docker build --no-cache -t vesoft/third-party-build:$* -f buildx/$*.Dockerfile .

push-%: build-%
@echo '******************' Pushing image $*-$(arch) '********************'
@docker push vesoft/third-party-build:$*-$(arch)
@echo '******************' Pushing image $* '********************'
@docker push vesoft/third-party-build:$*

%: push-% ;
13 changes: 13 additions & 0 deletions docker/buildx/centos-7.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM centos:7
SHELL ["/bin/bash", "-c"]
ARG GOLANG_VERSION=1.21.6
RUN yum install -y epel-release && yum update -y \
&& yum install -y make \
git \
Expand Down Expand Up @@ -41,6 +42,18 @@ RUN wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0
&& ./cmake-3.20.0-linux-$(uname -m).sh --skip-license --prefix=/usr/local \
&& rm cmake-3.20.0-linux-$(uname -m).sh

# Install golang
RUN ARCH="$(uname -m)"; \
case "${ARCH}" in \
x86_64) GOARCH='amd64';; \
aarch64) GOARCH='arm64';; \
*) echo "Unsupported architecture: ${ARCH}" && exit 1;; \
esac; \
curl -L https://go.dev/dl/go${GOLANG_VERSION}.linux-${GOARCH}.tar.gz -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"

# Install ossutil
RUN curl https://gosspublic.alicdn.com/ossutil/install.sh | bash

Expand Down
15 changes: 14 additions & 1 deletion docker/buildx/centos-8.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:8
SHELL ["/bin/bash", "-c"]

ARG GOLANG_VERSION=1.21.6
RUN cd /etc/yum.repos.d/ && \
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && \
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
Expand Down Expand Up @@ -33,6 +33,7 @@ RUN yum install -y epel-release yum-utils && yum config-manager --set-enabled p
flex \
gperf \
gettext \
libstdc++-devel \
&& yum --enablerepo=powertools install -y ninja-build \
&& yum clean all && rm -rf /var/cache/yum

Expand All @@ -42,6 +43,18 @@ RUN wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0
&& ./cmake-3.20.0-linux-$(uname -m).sh --skip-license --prefix=/usr/local \
&& rm cmake-3.20.0-linux-$(uname -m).sh

# Install golang
RUN ARCH="$(uname -m)"; \
case "${ARCH}" in \
x86_64) GOARCH='amd64';; \
aarch64) GOARCH='arm64';; \
*) echo "Unsupported architecture: ${ARCH}" && exit 1;; \
esac; \
curl -L https://go.dev/dl/go${GOLANG_VERSION}.linux-${GOARCH}.tar.gz -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"

# Install ossutil
RUN curl https://gosspublic.alicdn.com/ossutil/install.sh | bash

Expand Down
13 changes: 13 additions & 0 deletions docker/buildx/rockylinux-8.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM rockylinux:8
SHELL ["/bin/bash", "-c"]
ARG GOLANG_VERSION=1.21.6
RUN yum install -y epel-release yum-utils && yum config-manager --set-enabled powertools && yum update -y \
&& yum install -y make \
git \
Expand Down Expand Up @@ -37,6 +38,18 @@ RUN wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0
&& ./cmake-3.20.0-linux-$(uname -m).sh --skip-license --prefix=/usr/local \
&& rm cmake-3.20.0-linux-$(uname -m).sh

# Install golang
RUN ARCH="$(uname -m)"; \
case "${ARCH}" in \
x86_64) GOARCH='amd64';; \
aarch64) GOARCH='arm64';; \
*) echo "Unsupported architecture: ${ARCH}" && exit 1;; \
esac; \
curl -L https://go.dev/dl/go${GOLANG_VERSION}.linux-${GOARCH}.tar.gz -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"

# Install ossutil
RUN curl https://gosspublic.alicdn.com/ossutil/install.sh | bash

Expand Down
13 changes: 13 additions & 0 deletions docker/buildx/ubuntu-2004.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM ubuntu:20.04
SHELL ["/bin/bash", "-c"]
ARG GOLANG_VERSION=1.21.6
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update \
Expand Down Expand Up @@ -37,6 +38,18 @@ RUN wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0
&& ./cmake-3.20.0-linux-$(uname -m).sh --skip-license --prefix=/usr/local \
&& rm cmake-3.20.0-linux-$(uname -m).sh

# Install golang
RUN ARCH="$(uname -m)"; \
case "${ARCH}" in \
x86_64) GOARCH='amd64';; \
aarch64) GOARCH='arm64';; \
*) echo "Unsupported architecture: ${ARCH}" && exit 1;; \
esac; \
curl -L https://go.dev/dl/go${GOLANG_VERSION}.linux-${GOARCH}.tar.gz -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"

# Install ossutil
RUN curl https://gosspublic.alicdn.com/ossutil/install.sh | bash

Expand Down

0 comments on commit 1fef037

Please sign in to comment.