Skip to content
Open
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
15 changes: 15 additions & 0 deletions .buildkite/artifact-test.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# syntax=docker/dockerfile:1.3-labs

FROM alpine:latest

RUN <<EOF
#!/bin/sh
set -eu

mkdir -p /build/dist /app/bin
echo "wheel-content-1.0" > /build/dist/mypackage-1.0.0.whl
echo "wheel-content-1.1" > /build/dist/mypackage-1.1.0.whl
echo "binary-content" > /app/bin/myapp
chmod +x /app/bin/myapp

EOF
12 changes: 12 additions & 0 deletions .buildkite/artifact-test.wanda.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: artifact-test
froms:
- alpine:latest
dockerfile: .buildkite/artifact-test.Dockerfile
artifacts:
- src: /app/bin/myapp
dst: bin/myapp
- src: /build/dist/*.whl
dst: wheels/
- src: /nonexistent/optional-file.txt
dst: optional.txt
optional: true
6 changes: 6 additions & 0 deletions .buildkite/forge.rayci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ steps:
- name: forge-arm64
wanda: .buildkite/forge-arm64.wanda.yaml
instance_type: builder-arm64

- name: artifact-test
tags:
- wanda
- raycicmd
wanda: .buildkite/artifact-test.wanda.yaml
3 changes: 3 additions & 0 deletions raycicmd/bk_pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,7 @@ var (

defaultArtifactPaths = []string{"/tmp/artifacts/**/*"}
windowsArtifactPaths = []string{`C:\tmp\artifacts\**\*`}

defaultArtifactsMountDir = "/tmp/artifacts"
windowsArtifactsMountDir = "/c/tmp/artifacts"
)
45 changes: 42 additions & 3 deletions raycicmd/converter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ func TestConvertPipelineStep(t *testing.T) {
"broken": skipQueue,
},

BuilderQueues: map[string]string{
"builder": "fakebuilder",
"builder-windows": "fakewinbuilder",
},

Env: map[string]string{
"BUILDKITE_BAZEL_CACHE_URL": "https://bazel-build-cache",
},
Expand Down Expand Up @@ -354,15 +359,18 @@ func TestConvertPipelineStep(t *testing.T) {
"matrix": []any{"py36", "py37"},
},
out: map[string]any{
"label": "my forge",
"key": "forge",
"commands": wandaCommands("beta"),
"label": "my forge",
"key": "forge",
"commands": wandaCommands("beta"),
"agents": newBkAgents("fakebuilder"),
"artifact_paths": defaultArtifactPaths,
"env": map[string]string{
"RAYCI_BUILD_ID": buildID,
"RAYCI_TEMP": "s3://ci-temp/abc123/",
"BUILDKITE_BAZEL_CACHE_URL": "https://bazel-build-cache",
"RAYCI_WORK_REPO": "fakeecr",
"RAYCI_BRANCH": "beta",
"RAYCI_ARTIFACTS_DIR": "/tmp/artifacts",

"RAYCI_WANDA_FILE": "ci/forge.wanda.yaml",
"RAYCI_WANDA_NAME": "forge",
Expand All @@ -378,6 +386,37 @@ func TestConvertPipelineStep(t *testing.T) {
},
"timeout_in_minutes": 300,
},
}, {
// Windows wanda step
in: map[string]any{
"name": "windows-forge",
"wanda": "ci/windows.wanda.yaml",
"instance_type": "builder-windows",
},
out: map[string]any{
"label": "wanda: windows-forge",
"key": "windows-forge",
"commands": wandaCommands("beta"),
"artifact_paths": windowsArtifactPaths,
"env": map[string]string{
"RAYCI_BUILD_ID": buildID,
"RAYCI_TEMP": "s3://ci-temp/abc123/",
"BUILDKITE_BAZEL_CACHE_URL": "https://bazel-build-cache",
"RAYCI_WORK_REPO": "fakeecr",
"RAYCI_BRANCH": "beta",
"RAYCI_ARTIFACTS_DIR": "/c/tmp/artifacts",

"RAYCI_WANDA_FILE": "ci/windows.wanda.yaml",
"RAYCI_WANDA_NAME": "windows-forge",

"BUILDKITE_ARTIFACT_UPLOAD_DESTINATION": artifactDest,
},
"retry": map[string]any{
"automatic": map[string]any{"limit": 1},
},
"timeout_in_minutes": 300,
"agents": newBkAgents("fakewinbuilder"),
},
}, {
in: map[string]any{
"label": "windows job",
Expand Down
12 changes: 12 additions & 0 deletions raycicmd/wanda.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"log"
"path"
"sort"
"strings"
)

const rawGitHubURL = "https://raw.githubusercontent.com/"
Expand Down Expand Up @@ -72,6 +73,12 @@ func (s *wandaStep) buildkiteStep() map[string]any {
"timeout_in_minutes": defaultTimeoutInMinutes,
}

if strings.Contains(instanceType, "windows") {
bkStep["artifact_paths"] = windowsArtifactPaths
} else {
bkStep["artifact_paths"] = defaultArtifactPaths
}

if s.dependsOn != nil {
bkStep["depends_on"] = s.dependsOn
}
Expand Down Expand Up @@ -192,6 +199,11 @@ func (c *wandaConverter) convert(id string, step map[string]any) (
}
}
}
if strings.Contains(instanceType, "windows") {
envs["RAYCI_ARTIFACTS_DIR"] = windowsArtifactsMountDir
} else {
envs["RAYCI_ARTIFACTS_DIR"] = defaultArtifactsMountDir
}

s := &wandaStep{
name: name,
Expand Down