-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR aims at the following - Create a buildkite-hosted-agent for bacalhau - Create a bacalhau-golang pipeline - Add buildkite scripts for different components closes #4297
- Loading branch information
Showing
14 changed files
with
198 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
cache: | ||
paths: | ||
- "/golangci-lint-cache" | ||
- "/vendor-cache" | ||
- "/node-modules-cache" | ||
size: 20g | ||
name: "vendor-module-cache" | ||
|
||
steps: | ||
- label: ":golang: Lint" | ||
command: "./buildkite/scripts/lint.sh" | ||
key: "lint" | ||
agents: | ||
queue: "buildkite-hosted-linux-medium" | ||
|
||
- group: ":package: Build Tarball" | ||
key: "build-tarball" | ||
steps: | ||
- label: ":golang: Build linux amd64" | ||
command: "./buildkite/scripts/build_tarball.sh linux amd64" | ||
agents: | ||
queue: "buildkite-hosted-linux-small" | ||
|
||
- label: ":golang: Build linux arm64" | ||
command: "./buildkite/scripts/build_tarball.sh linux arm64" | ||
agents: | ||
queue: "buildkite-hosted-linux-small" | ||
|
||
- label: ":golang: Build linux armv6" | ||
command: "./buildkite/scripts/build_tarball.sh linux armv6" | ||
agents: | ||
queue: "buildkite-hosted-linux-small" | ||
|
||
- label: ":golang: Build linux armv7" | ||
command: "./buildkite/scripts/build_tarball.sh linux armv7" | ||
agents: | ||
queue: "buildkite-hosted-linux-small" | ||
|
||
- label: ":golang: Build darwin amd64" | ||
command: "./buildkite/scripts/build_tarball.sh darwin amd64" | ||
agents: | ||
queue: "buildkite-hosted-linux-small" | ||
|
||
- label: ":golang: Build darwin arm64" | ||
command: "./buildkite/scripts/build_tarball.sh darwin arm64" | ||
agents: | ||
queue: "buildkite-hosted-linux-small" | ||
|
||
- label: ":golang: Build windows amd64" | ||
command: "./buildkite/scripts/build_tarball.sh windows amd64" | ||
agents: | ||
queue: "buildkite-hosted-linux-small" | ||
|
||
- label: ":testengine: Unit Test" | ||
command: "./buildkite/scripts/test.sh unit" | ||
key: "unit-test" | ||
agents: | ||
queue: "buildkite-hosted-linux-large" | ||
|
||
- label: ":testengine: Integration Test" | ||
command: "./buildkite/scripts/test.sh integration" | ||
key: "integration-test" | ||
agents: | ||
queue: "buildkite-hosted-linux-large" |
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,19 @@ | ||
|
||
|
||
steps: | ||
- label: ":swagger: Generate Swagger" | ||
command: "./scripts/generate_swagger.sh" | ||
|
||
- wait: ~ | ||
|
||
- label: ":python: Build Python API Client" | ||
command: "make build-python-apiclient" | ||
|
||
- label: ":python: Build Python SDK" | ||
command: "make build-python-sdk" | ||
|
||
- label: ":python: Build Bacalhau Airflow Integration" | ||
command: "make build-bacalhau-airflow" | ||
|
||
- label: ":pytest: Test Bacalhau Python SDK" | ||
command: "make test-python-sdk" |
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 | ||
|
||
make build-python-apiclient |
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,9 @@ | ||
#!/bin/bash | ||
|
||
echo "$PRIVATE_PEM_B64" | base64 --decode > /tmp/private.pem | ||
echo "$PUBLIC_PEM_B64" | base64 --decode > /tmp/public.pem | ||
export PRIVATE_KEY_PASSPHRASE="$(echo $PRIVATE_KEY_PASSPHRASE_B64 | base64 --decode)" | ||
# Prevent rebuilding web ui, we should have already attached it | ||
find webui -exec touch -c '{}' + | ||
|
||
GOOS=$1 GOARCH=$2 make build-bacalhau-tgz |
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 | ||
|
||
make build-webui |
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,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
pre-commit run --show-diff-on-failure --color=always --all-files | ||
|
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,18 @@ | ||
#!/bin/bash | ||
|
||
export LOG_LEVEL=DEBUG | ||
export TEST_BUILD_TAGS=$1 | ||
export TEST_PARALLEL_PACKAGES=8 | ||
export BACALHAU_ENVIRONMENT=test | ||
export AWS_ACCESS_KEY_ID=$(buildkite-agent secret get AWS_ACCESS_KEY_ID) | ||
export AWS_SECRET_ACCESS_KEY=$(buildkite-agent secret get AWS_SECRET_ACCESS_KEY) | ||
export AWS_REGION=eu-west-1 | ||
|
||
ipfs init | ||
ipfs config Addresses.API /ip4/127.0.0.1/tcp/5001 | ||
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080 | ||
ipfs daemon --offline & | ||
export BACALHAU_NODE_IPFS_CONNECT=/ip4/127.0.0.1/tcp/5001 | ||
|
||
make build-webui | ||
make test-and-report |
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,55 @@ | ||
FROM docker.io/buildkite/hosted-agent-base:ubuntu-v1.0.0@sha256:af0d05215252cc0d362135fcf1f3413e6a5a2ff11e8c40d8b8ba453f4d7f245a | ||
|
||
ENV GOLANG_VERSION 1.21.0 | ||
|
||
RUN apt-get update && apt-get install -y wget make iproute2 | ||
|
||
# Set environment variables for Go | ||
RUN wget https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz \ | ||
&& tar -C /usr/local -xzf go${GOLANG_VERSION}.linux-amd64.tar.gz \ | ||
&& rm go${GOLANG_VERSION}.linux-amd64.tar.gz | ||
|
||
# Set Go environment variables | ||
ENV PATH /usr/local/go/bin:$PATH | ||
ENV GOPATH /usr/local/go | ||
ENV GO111MODULE on | ||
ENV CGO_ENABLED 0 | ||
|
||
|
||
# Install earthly | ||
RUN wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly | ||
|
||
# Install golanci-lint | ||
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.59.1 | ||
|
||
# Install Python 3.10 | ||
RUN apt-get update && apt-get install -y \ | ||
python3.10 \ | ||
python3.10-venv \ | ||
python3.10-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Set Python 3.10 as the default python3 | ||
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 | ||
|
||
# Install Pre Commit | ||
RUN pip install pre-commit | ||
|
||
# Install GoTestSum | ||
RUN go install gotest.tools/[email protected] | ||
|
||
# Install Swag for Swagger Generation | ||
RUN go install github.com/swaggo/swag/cmd/swag@latest | ||
|
||
# Verify installations | ||
RUN go version && python3 --version | ||
|
||
# Install IPFS | ||
ENV ipfs_version v0.18.0 | ||
|
||
|
||
RUN wget https://dist.ipfs.tech/go-ipfs/${ipfs_version}/go-ipfs_${ipfs_version}_linux-amd64.tar.gz -O ipfs.tar.gz \ | ||
&& tar -xzf ipfs.tar.gz \ | ||
&& cd go-ipfs \ | ||
&& sudo bash install.sh \ | ||
&& ipfs --version |
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