Skip to content

Commit

Permalink
fix: create templates for export and import
Browse files Browse the repository at this point in the history
  • Loading branch information
highpon committed Nov 14, 2024
1 parent 25c2220 commit 5123599
Show file tree
Hide file tree
Showing 11 changed files with 461 additions and 5 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/dockers-index-exportation-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#
# Copyright (C) 2019-2024 vdaas.org vald team <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# DO_NOT_EDIT this workflow file is generated by https://github.com/vdaas/vald/blob/main/hack/actions/gen/main.go

name: 'Build docker image: index-exportation'
on:
push:
branches:
- main
- release/v*.*
- '!release/v*.*.*'
tags:
- '*.*.*'
- v*.*.*
- '*.*.*-*'
- v*.*.*-*
pull_request:
paths:
- hack/docker/gen/main.go
- dockers/index/job/exportation/Dockerfile
- hack/actions/gen/main.go
- .github/workflows/dockers-index-exportation-image.yaml
- .github/actions/docker-build/action.yaml
- .github/workflows/_docker-image.yaml
- cmd/index/job/exportation/**
- pkg/index/job/exportation/**
- apis/grpc/**
- apis/proto/**
- go.mod
- go.sum
- versions/GO_VERSION
- internal/**
- '!internal/**/*_test.go'
- '!internal/**/*_mock.go'
- '!internal/db/**'
- '!internal/k8s/**'
- Makefile
- Makefile.d/**
pull_request_target:
paths:
- hack/docker/gen/main.go
- dockers/index/job/exportation/Dockerfile
- hack/actions/gen/main.go
- .github/workflows/dockers-index-exportation-image.yaml
- .github/actions/docker-build/action.yaml
- .github/workflows/_docker-image.yaml
- cmd/index/job/exportation/**
- pkg/index/job/exportation/**
- apis/grpc/**
- apis/proto/**
- go.mod
- go.sum
- versions/GO_VERSION
- internal/**
- '!internal/**/*_test.go'
- '!internal/**/*_mock.go'
- '!internal/db/**'
- '!internal/k8s/**'
- Makefile
- Makefile.d/**
jobs:
build:
uses: ./.github/workflows/_docker-image.yaml
with:
target: index-exportation
secrets: inherit
80 changes: 80 additions & 0 deletions .github/workflows/dockers-index-importation-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#
# Copyright (C) 2019-2024 vdaas.org vald team <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# DO_NOT_EDIT this workflow file is generated by https://github.com/vdaas/vald/blob/main/hack/actions/gen/main.go

name: 'Build docker image: index-importation'
on:
push:
branches:
- main
- release/v*.*
- '!release/v*.*.*'
tags:
- '*.*.*'
- v*.*.*
- '*.*.*-*'
- v*.*.*-*
pull_request:
paths:
- hack/docker/gen/main.go
- dockers/index/job/importation/Dockerfile
- hack/actions/gen/main.go
- .github/workflows/dockers-index-importation-image.yaml
- .github/actions/docker-build/action.yaml
- .github/workflows/_docker-image.yaml
- cmd/index/job/importation/**
- pkg/index/job/importation/**
- apis/grpc/**
- apis/proto/**
- go.mod
- go.sum
- versions/GO_VERSION
- internal/**
- '!internal/**/*_test.go'
- '!internal/**/*_mock.go'
- '!internal/db/**'
- '!internal/k8s/**'
- Makefile
- Makefile.d/**
pull_request_target:
paths:
- hack/docker/gen/main.go
- dockers/index/job/importation/Dockerfile
- hack/actions/gen/main.go
- .github/workflows/dockers-index-importation-image.yaml
- .github/actions/docker-build/action.yaml
- .github/workflows/_docker-image.yaml
- cmd/index/job/importation/**
- pkg/index/job/importation/**
- apis/grpc/**
- apis/proto/**
- go.mod
- go.sum
- versions/GO_VERSION
- internal/**
- '!internal/**/*_test.go'
- '!internal/**/*_mock.go'
- '!internal/db/**'
- '!internal/k8s/**'
- Makefile
- Makefile.d/**
jobs:
build:
uses: ./.github/workflows/_docker-image.yaml
with:
target: index-importation
secrets: inherit
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ HELM_OPERATOR_IMAGE = $(NAME)-helm-operator
INDEX_CORRECTION_IMAGE = $(NAME)-index-correction
INDEX_CREATION_IMAGE = $(NAME)-index-creation
INDEX_DELETION_IMAGE = $(NAME)-index-deletion
INDEX_EXPORTATION_IMAGE = $(NAME)-index-exportion
INDEX_IMPORTATION_IMAGE = $(NAME)-index-importation
INDEX_OPERATOR_IMAGE = $(NAME)-index-operator
INDEX_SAVE_IMAGE = $(NAME)-index-save
LB_GATEWAY_IMAGE = $(NAME)-lb-gateway
Expand Down
20 changes: 20 additions & 0 deletions Makefile.d/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ binary/build: \
cmd/index/job/correction/index-correction \
cmd/index/job/creation/index-creation \
cmd/index/job/deletion/index-deletion \
cmd/index/job/exportation/index-exportation \
cmd/index/job/importation/index-importation \
cmd/index/job/readreplica/rotate/readreplica-rotate \
cmd/index/job/save/index-save \
cmd/index/operator/index-operator \
Expand Down Expand Up @@ -85,6 +87,14 @@ cmd/index/job/deletion/index-deletion:
$(eval CGO_ENABLED = 0)
$(call go-build,index/job/deletion,,-static,,,$@)

cmd/index/job/exportation/index-exportation:
$(eval CGO_ENABLED = 0)
$(call go-build,index/job/exportation,,-static,,,$@)

cmd/index/job/importation/index-importation:
$(eval CGO_ENABLED = 0)
$(call go-build,index/job/importation,,-static,,,$@)

cmd/index/job/save/index-save:
$(eval CGO_ENABLED = 0)
$(call go-build,index/job/save,,-static,,,$@)
Expand Down Expand Up @@ -134,6 +144,8 @@ binary/build/zip: \
artifacts/vald-index-correction-$(GOOS)-$(GOARCH).zip \
artifacts/vald-index-creation-$(GOOS)-$(GOARCH).zip \
artifacts/vald-index-deletion-$(GOOS)-$(GOARCH).zip \
artifacts/vald-index-exportation-$(GOOS)-$(GOARCH).zip \
artifacts/vald-index-importation-$(GOOS)-$(GOARCH).zip \
artifacts/vald-index-operator-$(GOOS)-$(GOARCH).zip \
artifacts/vald-index-save-$(GOOS)-$(GOARCH).zip \
artifacts/vald-lb-gateway-$(GOOS)-$(GOARCH).zip \
Expand Down Expand Up @@ -197,6 +209,14 @@ artifacts/vald-index-deletion-$(GOOS)-$(GOARCH).zip: cmd/index/job/deletion/inde
$(call mkdir, $(dir $@))
zip --junk-paths $@ $<

artifacts/vald-index-exporation-$(GOOS)-$(GOARCH).zip: cmd/index/job/exportation/index-exportation
$(call mkdir, $(dir $@))
zip --junk-paths $@ $<

artifacts/vald-index-importation-$(GOOS)-$(GOARCH).zip: cmd/index/job/importation/index-importation
$(call mkdir, $(dir $@))
zip --junk-paths $@ $<

artifacts/vald-index-save-$(GOOS)-$(GOARCH).zip: cmd/index/job/save/index-save
$(call mkdir, $(dir $@))
zip --junk-paths $@ $<
Expand Down
26 changes: 26 additions & 0 deletions Makefile.d/docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ docker/build: \
docker/build/index-correction \
docker/build/index-creation \
docker/build/index-deletion \
docker/build/index-exportation \
docker/build/index-importation \
docker/build/index-operator \
docker/build/index-save \
docker/build/loadtest \
Expand Down Expand Up @@ -65,6 +67,8 @@ docker/xpanes/build:
docker/build/index-correction \
docker/build/index-creation \
docker/build/index-deletion \
docker/build/index-exportation \
docker/build/index-importation \
docker/build/index-operator \
docker/build/index-save \
docker/build/loadtest \
Expand Down Expand Up @@ -354,6 +358,28 @@ docker/build/index-deletion:
IMAGE=$(INDEX_DELETION_IMAGE) \
docker/build/image

.PHONY: docker/name/index-exportation
docker/name/index-exporation:
@echo "$(ORG)/$(INDEX_EXPORTATION_IMAGE)"

.PHONY: docker/build/index-exportation
## build index-exportation image
docker/build/index-exportation:
@make DOCKERFILE="$(ROOTDIR)/dockers/index/job/exportation/Dockerfile" \
IMAGE=$(INDEX_EXPORTATION_IMAGE) \
docker/build/image

.PHONY: docker/name/index-importation
docker/name/index-importation:
@echo "$(ORG)/$(INDEX_IMPORTATION_IMAGE)"

.PHONY: docker/build/index-importation
## build index-importation image
docker/build/index-importation:
@make DOCKERFILE="$(ROOTDIR)/dockers/index/job/importation/Dockerfile" \
IMAGE=$(INDEX_IMPORTATION_IMAGE) \
docker/build/image

.PHONY: docker/name/index-operator
docker/name/index-operator:
@echo "$(ORG)/$(INDEX_OPERATOR_IMAGE)"
Expand Down
28 changes: 28 additions & 0 deletions cmd/index/job/exportation/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (C) 2019-2024 vdaas.org vald team <[email protected]>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package main

import (
"fmt"
)

const (
maxVersion = "v0.0.10"
minVersion = "v0.0.0"
name = "index exportation job"
)

func main() {
fmt.Println("hello world")
}
28 changes: 28 additions & 0 deletions cmd/index/job/importation/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (C) 2019-2024 vdaas.org vald team <[email protected]>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package main

import (
"fmt"
)

const (
maxVersion = "v0.0.10"
minVersion = "v0.0.0"
name = "index importation job"
)

func main() {
fmt.Println("hello world")
}
Loading

0 comments on commit 5123599

Please sign in to comment.