-
Notifications
You must be signed in to change notification settings - Fork 37
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 #258 from apecloud/main
merge from cubetran-core
- Loading branch information
Showing
274 changed files
with
8,596 additions
and
2,358 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,55 @@ | ||
name: Build and push images | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
required: true | ||
type: string | ||
default: main | ||
docker_repository: | ||
required: true | ||
type: string | ||
default: apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com | ||
image_tag: | ||
required: true | ||
type: string | ||
default: apecloud/ape-dts:latest | ||
|
||
jobs: | ||
build: | ||
name: Cross build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
|
||
- name: Set up rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Install cross | ||
run: cargo install cross | ||
|
||
- name: Build for x86_64 | ||
run: cross build --target x86_64-unknown-linux-gnu --release | ||
|
||
- name: Build for aarch64 | ||
run: cross build --target aarch64-unknown-linux-gnu --release | ||
|
||
- name: Rename artifact | ||
run: | | ||
cp target/x86_64-unknown-linux-gnu/release/dt-main amd64-unknown-linux-gnu-dt-main | ||
cp target/aarch64-unknown-linux-gnu/release/dt-main arm64-unknown-linux-gnu-dt-main | ||
- name: Set up docker buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Build and push docker image | ||
run: | | ||
docker login --username ${{ secrets.DOCKER_USER }} --password ${{ secrets.DOCKER_PASSWORD }} ${{ inputs.docker_repository }} | ||
docker buildx build -f Dockerfile.github.workflow --platform linux/arm64,linux/amd64 --tag ${{ inputs.docker_repository }}/${{ inputs.image_tag }} --push . |
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 @@ | ||
name: Build and upload to S3 | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
required: true | ||
type: string | ||
default: main | ||
aws_endpoint: | ||
required: true | ||
type: string | ||
default: https://s3.ap-northeast-1.amazonaws.com | ||
aws_bucket: | ||
required: true | ||
type: string | ||
default: foxlake | ||
aws_destination_dir: | ||
required: true | ||
type: string | ||
default: ape-dts/latest | ||
|
||
jobs: | ||
build: | ||
name: Cross build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
|
||
- name: Set up rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Install cross | ||
run: cargo install cross | ||
|
||
- name: Build for x86_64 | ||
run: cross build --target x86_64-unknown-linux-gnu --release | ||
|
||
- name: Build for aarch64 | ||
run: cross build --target aarch64-unknown-linux-gnu --release | ||
|
||
- name: Copy artifacts | ||
run: | | ||
mkdir -p bin/arm64-unknown-linux-gnu bin/amd64-unknown-linux-gnu | ||
cp target/x86_64-unknown-linux-gnu/release/dt-main bin/amd64-unknown-linux-gnu/ape-dts | ||
cp target/aarch64-unknown-linux-gnu/release/dt-main bin/arm64-unknown-linux-gnu/ape-dts | ||
cp log4rs.yaml bin/amd64-unknown-linux-gnu/ | ||
cp log4rs.yaml bin/arm64-unknown-linux-gnu/ | ||
- name: Upload to s3 | ||
uses: shallwefootball/s3-upload-action@master | ||
with: | ||
aws_key_id: ${{ secrets.AWS_KEY_ID }} | ||
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}} | ||
aws_bucket: ${{ inputs.aws_bucket }} | ||
endpoint: ${{ inputs.aws_endpoint }} | ||
source_dir: bin | ||
destination_dir: ${{ inputs.aws_destination_dir }} |
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,18 @@ | ||
# refer to: https://github.com/cross-rs/cross/blob/main/docs/config_file.md | ||
[build] | ||
default-target = "x86_64-unknown-linux-gnu" # use this target if none is explicitly provided | ||
pre-build = [ # additional commands to run prior to building the package | ||
"dpkg --add-architecture $CROSS_DEB_ARCH", | ||
"apt-get update && apt-get -y install pkg-config libssl-dev:$CROSS_DEB_ARCH cmake libclang-dev", | ||
] | ||
|
||
[target.x86_64-unknown-linux-gnu] | ||
linker = "x86_64-linux-gnu-gcc" | ||
# disable target-feature=+crt-static since it causes failures in domain resolution | ||
# https://github.com/rust-lang/rust/issues/100711 | ||
# https://stackoverflow.com/questions/73402445/rust-x86-64-unknown-linux-gnu-using-target-feature-crt-static-exits-with-seg | ||
# rustflags = ["-C", "target-feature=+crt-static"] | ||
|
||
[target.aarch64-unknown-linux-gnu] | ||
linker = "aarch64-linux-gnu-gcc" | ||
# rustflags = ["-C", "target-feature=+crt-static"] |
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,10 @@ | ||
FROM gcr.io/distroless/cc:debug | ||
|
||
ARG MODULE_NAME="dt-main" | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
COPY --chmod=777 ${TARGETARCH}-unknown-${TARGETOS}-gnu-${MODULE_NAME} /ape-dts | ||
COPY log4rs.yaml /log4rs.yaml | ||
|
||
ENTRYPOINT [ "/ape-dts" ] |
File renamed without changes.
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.