-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b1c0675
commit 11e470b
Showing
15 changed files
with
957 additions
and
43 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,48 @@ | ||
name: Build Docker Images | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- 'v*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: [self-hosted, Linux, alibaba-cloud] | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- name: "Checking out code" | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: "Login to DockerHub" | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ secrets.DOCKER_REGISTRY_ADDRESS }} | ||
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} | ||
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | ||
- name: "Set up QEMU" | ||
uses: docker/setup-qemu-action@v1 | ||
with: | ||
image: tonistiigi/binfmt:master | ||
- name: "Set up Docker Buildx" | ||
uses: docker/setup-buildx-action@v1 | ||
- name: "Building docker images" | ||
run: | | ||
image="${{ secrets.DOCKER_REGISTRY_ADDRESS }}/cita-cloud/$(basename ${GITHUB_REPOSITORY})" | ||
tag=${GITHUB_REF#refs/heads/} | ||
if [ "$tag" = 'master' ] || [ "$tag" = 'main' ]; then | ||
tag=latest | ||
fi | ||
docker buildx build \ | ||
--output "type=image,push=true" \ | ||
--file "Dockerfile" \ | ||
--tag "${image}:${tag}" \ | ||
--platform "linux/amd64" \ | ||
"." | ||
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,67 @@ | ||
name: GPT Review | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
add_pr_comment: | ||
name: Azure OpenAI PR Review | ||
runs-on: [ self-hosted, Linux, alibaba-cloud ] | ||
|
||
env: | ||
GIT_COMMIT_HASH: ${{ github.event.pull_request.head.sha }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PR_NUMBER: ${{ github.event.pull_request.number }} | ||
PR_TITLE: ${{ github.event.pull_request.title }} | ||
REPOSITORY_NAME: ${{ github.repository }} | ||
AZURE_OPENAI_API: ${{ secrets.AZURE_OPENAI_API }} | ||
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} | ||
AZURE_GPT_NAME: ${{ secrets.AZURE_GPT_NAME }} | ||
AZURE_EMBEDDING_NAME: ${{ secrets.AZURE_EMBEDDING_NAME }} | ||
LINK: "https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}" | ||
FULL_SUMMARY: true | ||
FILE_SUMMARY: false | ||
TEST_SUMMARY: false | ||
BUG_SUMMARY: true | ||
RISK_SUMMARY: true | ||
RISK_BREAKING: true | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Check deps | ||
run: | | ||
pwd | ||
echo "generating azure.yaml..." | ||
echo "azure_model_map: | ||
turbo_llm_model_deployment_id: $AZURE_GPT_NAME | ||
smart_llm_model_deployment_id: $AZURE_GPT_NAME | ||
large_llm_model_deployment_id: $AZURE_GPT_NAME | ||
embedding_model_deployment_id: $AZURE_EMBEDDING_NAME | ||
" > azure.yaml | ||
cat azure.yaml | ||
echo "installing gpt-review..." | ||
sudo apt-get update | ||
python3 -m venv .env | ||
source .env/bin/activate | ||
python -m pip install --upgrade pip | ||
python -m pip install gpt-review | ||
echo "install done!" | ||
gpt ask "hello" | ||
- name: Gpt review | ||
run: | | ||
source .env/bin/activate | ||
gpt github review \ | ||
--access-token $GITHUB_TOKEN \ | ||
--pull-request $PR_NUMBER \ | ||
--repository $REPOSITORY_NAME |
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,82 @@ | ||
name: Rust Check | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- 'v*' | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
#GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
RUSTFLAGS: -Dwarnings | ||
RUST_BACKTRACE: 1 | ||
PROTOC_NO_VENDOR: 1 | ||
|
||
jobs: | ||
fmt: | ||
name: Fmt | ||
runs-on: [ self-hosted, Linux, alibaba-cloud ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: arduino/[email protected] | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: rustfmt | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
clippy: | ||
name: Clippy | ||
runs-on: [ self-hosted, Linux, alibaba-cloud ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: arduino/[email protected] | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: clippy | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: --all --all-targets | ||
|
||
test: | ||
name: Test | ||
runs-on: [ self-hosted, Linux, alibaba-cloud ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: arduino/[email protected] | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
|
||
build: | ||
name: Build | ||
runs-on: [ self-hosted, Linux, alibaba-cloud ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: arduino/[email protected] | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release |
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
.idea | ||
**/logs | ||
executor |
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,15 @@ | ||
FROM golang:1.21 AS builder | ||
|
||
WORKDIR /build | ||
|
||
COPY . /build | ||
|
||
RUN go mod tidy && go build -o executor . | ||
|
||
# TODO: Change to scratch | ||
FROM ubuntu:22.04 | ||
RUN useradd -m chain | ||
USER chain | ||
COPY --from=builder /build/executor /usr/bin/ | ||
COPY --from=ghcr.io/grpc-ecosystem/grpc-health-probe:v0.4.19 /ko-app/grpc-health-probe /usr/bin/ | ||
CMD ["executor"] |
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 |
---|---|---|
@@ -1,13 +1,20 @@ | ||
package main | ||
|
||
type ExecutorConfig struct { | ||
ExecutorPort uint16 `toml:"executor_port" json:"executor_port,omitempty"` | ||
EthCompatibility bool `toml:"eth_compatibility" json:"eth_compatibility,omitempty"` | ||
DbPath string `json:"db_path" json:"db_path,omitempty"` | ||
SyncMode string `json:"sync_mode" json:"sync_mode,omitempty"` | ||
EnableMetrics bool `json:"enable_metrics" json:"enable_metrics,omitempty"` | ||
MetricsPort uint16 `json:"metrics_port,omitempty"` | ||
MetricsBuckets []float64 `json:"metrics_buckets,omitempty"` | ||
Domain string `json:"domain,omitempty"` | ||
LogConfig interface{} `json:"log_config,omitempty"` | ||
ExecutorPort uint16 `toml:"executor_port" json:"executor_port,omitempty"` | ||
EthCompatibility bool `toml:"eth_compatibility" json:"eth_compatibility,omitempty"` | ||
DbPath string `toml:"db_path" json:"db_path" json:"db_path,omitempty"` | ||
SyncMode string `toml:"sync_mode" json:"sync_mode,omitempty"` | ||
EnableMetrics bool `toml:"enable_metrics" json:"enable_metrics,omitempty"` | ||
MetricsPort uint16 `toml:"metrics_port" json:"metrics_port,omitempty"` | ||
MetricsBuckets []float64 `toml:"metrics_buckets" json:"metrics_buckets,omitempty"` | ||
Domain string `toml:"domain" json:"domain,omitempty"` | ||
LogConfig LogConfig `toml:"log_config" json:"log_config,omitempty"` | ||
} | ||
|
||
type LogConfig struct { | ||
Filter string `json:"filter,omitempty"` | ||
MaxLevel string `toml:"max_level" json:"max_level,omitempty"` | ||
RollingFilePath string `toml:"rolling_file_path" json:"rolling_file_path,omitempty"` | ||
ServiceName string `toml:"service_name" json:"service_name,omitempty"` | ||
} |
Oops, something went wrong.