Skip to content

Commit c35f6d5

Browse files
feat(raycicmd): set RAYCI_ARTIFACTS_DIR for wanda steps
Set RAYCI_ARTIFACTS_DIR environment variable for wanda steps based on the target platform. Uses /c/artifact-mount for Windows (detected via instance_type containing "windows") and /artifact-mount for other platforms. This enables wanda to extract build artifacts to the correct location for Buildkite artifact upload. Topic: raycicmd-artifacts Relative: wanda-artifact-cli Signed-off-by: andrew <andrew@anyscale.com>
1 parent e090ae8 commit c35f6d5

File tree

7 files changed

+72
-3
lines changed

7 files changed

+72
-3
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM alpine:latest
2+
3+
RUN mkdir -p /build/dist /app/bin \
4+
&& echo "wheel-content-1.0" > /build/dist/mypackage-1.0.0.whl \
5+
&& echo "wheel-content-1.1" > /build/dist/mypackage-1.1.0.whl \
6+
&& echo "binary-content" > /app/bin/myapp \
7+
&& chmod +x /app/bin/myapp
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: artifact-test
2+
froms:
3+
- alpine:latest
4+
dockerfile: .buildkite/artifact-test.Dockerfile
5+
artifacts:
6+
- src: /app/bin/myapp
7+
dst: bin/myapp
8+
- src: /build/dist/*.whl
9+
dst: wheels/
10+
- src: /nonexistent/optional-file.txt
11+
dst: optional.txt
12+
optional: true

.buildkite/forge.rayci.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,9 @@ steps:
3434
- name: forge-arm64
3535
wanda: .buildkite/forge-arm64.wanda.yaml
3636
instance_type: builder-arm64
37+
38+
- name: artifact-test
39+
tags:
40+
- wanda
41+
- raycicmd
42+
wanda: .buildkite/artifact-test.wanda.yaml

raycicmd/bk_pipeline.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,7 @@ var (
220220

221221
defaultArtifactPaths = []string{"/tmp/artifacts/**/*"}
222222
windowsArtifactPaths = []string{`C:\tmp\artifacts\**\*`}
223+
224+
defaultArtifactsMountDir = "/artifact-mount"
225+
windowsArtifactsMountDir = "/c/artifact-mount"
223226
)

raycicmd/converter.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package raycicmd
22

3-
import (
4-
"fmt"
5-
)
3+
import "fmt"
64

75
type converter struct {
86
config *config

raycicmd/converter_test.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ func TestConvertPipelineStep(t *testing.T) {
139139
"broken": skipQueue,
140140
},
141141

142+
BuilderQueues: map[string]string{
143+
"builder": "fakebuilder",
144+
"builder-windows": "fakewinbuilder",
145+
},
146+
142147
Env: map[string]string{
143148
"BUILDKITE_BAZEL_CACHE_URL": "https://bazel-build-cache",
144149
},
@@ -357,12 +362,14 @@ func TestConvertPipelineStep(t *testing.T) {
357362
"label": "my forge",
358363
"key": "forge",
359364
"commands": wandaCommands("beta"),
365+
"agents": newBkAgents("fakebuilder"),
360366
"env": map[string]string{
361367
"RAYCI_BUILD_ID": buildID,
362368
"RAYCI_TEMP": "s3://ci-temp/abc123/",
363369
"BUILDKITE_BAZEL_CACHE_URL": "https://bazel-build-cache",
364370
"RAYCI_WORK_REPO": "fakeecr",
365371
"RAYCI_BRANCH": "beta",
372+
"RAYCI_ARTIFACTS_DIR": "/artifact-mount",
366373

367374
"RAYCI_WANDA_FILE": "ci/forge.wanda.yaml",
368375
"RAYCI_WANDA_NAME": "forge",
@@ -378,6 +385,36 @@ func TestConvertPipelineStep(t *testing.T) {
378385
},
379386
"timeout_in_minutes": 300,
380387
},
388+
}, {
389+
// Windows wanda step
390+
in: map[string]any{
391+
"name": "windows-forge",
392+
"wanda": "ci/windows.wanda.yaml",
393+
"instance_type": "builder-windows",
394+
},
395+
out: map[string]any{
396+
"label": "wanda: windows-forge",
397+
"key": "windows-forge",
398+
"commands": wandaCommands("beta"),
399+
"env": map[string]string{
400+
"RAYCI_BUILD_ID": buildID,
401+
"RAYCI_TEMP": "s3://ci-temp/abc123/",
402+
"BUILDKITE_BAZEL_CACHE_URL": "https://bazel-build-cache",
403+
"RAYCI_WORK_REPO": "fakeecr",
404+
"RAYCI_BRANCH": "beta",
405+
"RAYCI_ARTIFACTS_DIR": "/c/artifact-mount",
406+
407+
"RAYCI_WANDA_FILE": "ci/windows.wanda.yaml",
408+
"RAYCI_WANDA_NAME": "windows-forge",
409+
410+
"BUILDKITE_ARTIFACT_UPLOAD_DESTINATION": artifactDest,
411+
},
412+
"retry": map[string]any{
413+
"automatic": map[string]any{"limit": 1},
414+
},
415+
"timeout_in_minutes": 300,
416+
"agents": newBkAgents("fakewinbuilder"),
417+
},
381418
}, {
382419
in: map[string]any{
383420
"label": "windows job",

raycicmd/wanda.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"log"
66
"path"
77
"sort"
8+
"strings"
89
)
910

1011
const rawGitHubURL = "https://raw.githubusercontent.com/"
@@ -192,6 +193,11 @@ func (c *wandaConverter) convert(id string, step map[string]any) (
192193
}
193194
}
194195
}
196+
if strings.Contains(instanceType, "windows") {
197+
envs["RAYCI_ARTIFACTS_DIR"] = windowsArtifactsMountDir
198+
} else {
199+
envs["RAYCI_ARTIFACTS_DIR"] = defaultArtifactsMountDir
200+
}
195201

196202
s := &wandaStep{
197203
name: name,

0 commit comments

Comments
 (0)