Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

jobs:
build-max2max:
build-mc2mc:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -21,7 +21,7 @@ jobs:
# Build the Go binary
- name: Build
run: |
cd max2max
cd mc2mc
mkdir build
go get .
env GOOS=linux GOARCH=amd64 go build -o ./build/max2max .
env GOOS=linux GOARCH=amd64 go build -o ./build/mc2mc .
20 changes: 10 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
tags:
- 'bq2bq/v*'
- 'max2max/v*'
- 'mc2mc/v*'

jobs:
bq2bq:
Expand Down Expand Up @@ -42,8 +42,8 @@ jobs:
docker.io/gotocompany/optimus-task-bq2bq-executor:${{ steps.vars.outputs.tag }}
- name: Log out from Docker Hub
run: docker logout
max2max:
if: startsWith(github.ref, 'refs/tags/max2max/v')
mc2mc:
if: startsWith(github.ref, 'refs/tags/mc2mc/v')
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -57,10 +57,10 @@ jobs:
# Build the Go binary
- name: Build
run: |
cd max2max
cd mc2mc
mkdir build
go get .
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./build/max2max .
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./build/mc2mc .
- name: Login to DockerHub
uses: docker/login-action@v1
with:
Expand All @@ -71,20 +71,20 @@ jobs:
- name: Extract tag version
id: vars
run: |
# Extract the tag name from GITHUB_REF, remove 'refs/tags/max2max/v' prefix
TAG="${GITHUB_REF#refs/tags/max2max/}"
# Extract the tag name from GITHUB_REF, remove 'refs/tags/mc2mc/v' prefix
TAG="${GITHUB_REF#refs/tags/mc2mc/}"
TAG="${TAG#v}"
echo "Tag name: $TAG"
echo "::set-output name=tag::$TAG"
# Build and push the Docker image to Docker Hub
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./max2max
context: ./mc2mc
platforms: linux/amd64 # Specify the target platforms
push: true
tags: |
docker.io/gotocompany/max2max:latest
docker.io/gotocompany/max2max:${{ steps.vars.outputs.tag }}
docker.io/gotocompany/mc2mc:latest
docker.io/gotocompany/mc2mc:${{ steps.vars.outputs.tag }}
- name: Log out from Docker Hub
run: docker logout
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
cd ./bq2bq
chmod +x ./run_coverage.sh
./run_coverage.sh
max2max:
mc2mc:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -38,6 +38,6 @@ jobs:
# Build the Go binary
- name: Build
run: |
cd max2max
cd mc2mc
go get .
go test ./...
6 changes: 0 additions & 6 deletions max2max/Dockerfile

This file was deleted.

File renamed without changes.
6 changes: 6 additions & 0 deletions mc2mc/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM alpine:3

RUN apk --no-cache add tzdata
COPY ./build/mc2mc /usr/local/bin/mc2mc

ENTRYPOINT ["/usr/local/bin/mc2mc"]
2 changes: 1 addition & 1 deletion max2max/go.mod → mc2mc/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/goto/transformers/max2max
module github.com/goto/transformers/mc2mc

go 1.22.3

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"
"testing"

"github.com/goto/transformers/max2max/internal/client"
"github.com/goto/transformers/mc2mc/internal/client"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func setupOTelSDK(ctx context.Context, collectorGRPCEndpoint string, jobName, sc
meterProvider := metric.NewMeterProvider(
metric.WithResource(resource.NewWithAttributes(
resource.Default().SchemaURL(),
attribute.String("plugin.name", "max2max"),
attribute.String("plugin.name", "mc2mc"),
attribute.String("job.name", jobName),
attribute.String("job.scheduled_time", scheduledTime),
)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package client

import (
"github.com/aliyun/aliyun-odps-go-sdk/odps"
"github.com/goto/transformers/max2max/internal/loader"
"github.com/goto/transformers/max2max/internal/logger"
"github.com/goto/transformers/mc2mc/internal/loader"
"github.com/goto/transformers/mc2mc/internal/logger"
"github.com/pkg/errors"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type maxComputeCredentials struct {
func NewConfig() (*Config, error) {
cfg := &Config{
Config: odps.NewConfig(),
// max2max related config
// mc2mc related config
LogLevel: getEnv("LOG_LEVEL", "INFO"),
LoadMethod: getEnv("LOAD_METHOD", "APPEND"),
QueryFilePath: getEnv("QUERY_FILE_PATH", "/data/in/query.sql"),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions max2max/main.go → mc2mc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
)

func main() {
// max2max is the main function to execute the max2max transformation
// mc2mc is the main function to execute the mc2mc transformation
// which reads the configuration, sets up the client and executes the query.
// It also handles graceful shutdown by listening to os signals.
// It returns error if any.
if err := max2max(); err != nil {
if err := mc2mc(); err != nil {
fmt.Printf("error: %+v\n", err)
os.Exit(1)
}
Expand Down
6 changes: 3 additions & 3 deletions max2max/max2max.go → mc2mc/mc2mc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
"os/signal"
"syscall"

"github.com/goto/transformers/max2max/internal/client"
"github.com/goto/transformers/max2max/internal/config"
"github.com/goto/transformers/mc2mc/internal/client"
"github.com/goto/transformers/mc2mc/internal/config"
"github.com/pkg/errors"
)

func max2max() error {
func mc2mc() error {
// load config
cfg, err := config.NewConfig()
if err != nil {
Expand Down
Loading