Skip to content

Commit

Permalink
TMP
Browse files Browse the repository at this point in the history
  • Loading branch information
l0kix2 committed Oct 11, 2024
1 parent 58fd2b6 commit 7b186d9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 14 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,11 @@ kind-delete-local-registry: ## Delete local docker registry.
TEST_IMAGES = \
ytsaurus/ytsaurus-nightly:dev-23.1-28ccaedbf353b870bedafb6e881ecf386a0a3779 \
ytsaurus/ytsaurus-nightly:dev-23.1-9779e0140ff73f5a786bd5362313ef9a74fcd0de \
ytsaurus/ytsaurus-nightly:dev-23.2-9c50056eacfa4fe213798a5b9ee828ae3acb1bca
ytsaurus/ytsaurus-nightly:dev-23.2-9c50056eacfa4fe213798a5b9ee828ae3acb1bca \
ytsaurus/ytsaurus-nightly:dev-23.2-e98a2d511dcafd930d6618317f5b79dedc5abdc9 \
ytsaurus/ytsaurus-nightly:dev-24.1-70487-f6622682d3810dd8972be1739e678821541ae80e \
ghcr.io/ytsaurus/ytsaurus-nightly:dev-2024-10-11-1ab0d5d4b54b30f0a9ea5f55ee32fd5bd6ab1e76

.PHONY: kind-load-test-images
kind-load-test-images:
$(foreach img,$(TEST_IMAGES),docker pull -q $(img) && $(KIND) load docker-image --name $(KIND_CLUSTER_NAME) $(img);)
Expand Down
24 changes: 14 additions & 10 deletions pkg/components/queue_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,24 +302,28 @@ func (qa *QueueAgent) prepareInitQueueAgentState() {
path := "/usr/bin/init_queue_agent_state"
proxy := qa.cfgen.GetHTTPProxiesServiceAddress(consts.DefaultHTTPProxyRole)

existenceCheck := fmt.Sprintf(
`if [[ ! -f \"%s\" ]] && echo "%s doesn't exist, nothing to do" && exit 0`,
path,
path,
)
oldVersionInvokation := fmt.Sprintf("%s --create-registration-table --create-replicated-table-mapping-table --recursive --ignore-existing --proxy %s;",
oldVersionInvokation := fmt.Sprintf("%s --create-registration-table --create-replicated-table-mapping-table --recursive --ignore-existing --proxy %s",
path,
proxy,
)
newVersionInvokation := fmt.Sprintf("%s --create-registration-table --create-replicated-table-mapping-table --recursive --ignore-existing --latest --proxy %s;",
newVersionInvokation := fmt.Sprintf("%s --latest --proxy %s",
path,
proxy,
)

script := []string{
initJobWithNativeDriverPrologue(),
existenceCheck,
`[[ "$YTSAURUS_VERSION" < "24.1" ]] &&` + oldVersionInvokation,
`[[ "$YTSAURUS_VERSION" >= "24.2" ]] &&` + newVersionInvokation,
fmt.Sprintf(`if [ ! -f %s ]; then`, path),
fmt.Sprintf(`echo "%s doesn't exist, nothing to do"`, path),
`exit 0`,
`fi`,
`set +e`,
newVersionInvokation,
`if [ $? -ne 0 ]; then`,
`set -e`,
`echo "Binary execution failed. Running with an old set of arguments"`,
oldVersionInvokation,
`fi`,
}

qa.initQAState.SetInitScript(strings.Join(script, "\n"))
Expand Down
9 changes: 6 additions & 3 deletions pkg/testutil/spec_builders.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ const (
RemoteResourceName = "tst-rmt"
// Images should be in sync with TEST_IMAGES variable in Makefile
// todo: come up with a more elegant solution
CoreImageFirst = "ytsaurus/ytsaurus-nightly:dev-23.1-9779e0140ff73f5a786bd5362313ef9a74fcd0de"
CoreImageSecond = "ytsaurus/ytsaurus-nightly:dev-23.1-28ccaedbf353b870bedafb6e881ecf386a0a3779"
CoreImageNextVer = "ytsaurus/ytsaurus-nightly:dev-23.2-9c50056eacfa4fe213798a5b9ee828ae3acb1bca"
CoreImageFirst = "ytsaurus/ytsaurus-nightly:dev-23.1-9779e0140ff73f5a786bd5362313ef9a74fcd0de"
CoreImageSecond = "ytsaurus/ytsaurus-nightly:dev-23.1-28ccaedbf353b870bedafb6e881ecf386a0a3779"
// this 24.1 has old qa script
//CoreImageNextVer = "ytsaurus/ytsaurus-nightly:dev-24.1-70487-f6622682d3810dd8972be1739e678821541ae80e"

Check failure on line 29 in pkg/testutil/spec_builders.go

View workflow job for this annotation

GitHub Actions / Run checks

commentFormatting: put a space between `//` and comment text (gocritic)
CoreImageNextVer = "ghcr.io/ytsaurus/ytsaurus-nightly:dev-2024-10-11-1ab0d5d4b54b30f0a9ea5f55ee32fd5bd6ab1e76"
)

var (
Expand Down Expand Up @@ -212,6 +214,7 @@ func WithQueueAgent(ytsaurus *ytv1.Ytsaurus) *ytv1.Ytsaurus {
ytsaurus.Spec.QueueAgents = &ytv1.QueueAgentSpec{
InstanceSpec: ytv1.InstanceSpec{
InstanceCount: 1,
Image: ptr.To(CoreImageNextVer),
},
}
return ytsaurus
Expand Down

0 comments on commit 7b186d9

Please sign in to comment.