Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(sdk): build wheels on musllinux #7490

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ jobs:
name: Run wandb core's Go tests and collect coverage
command: |
cd core
go test -race -coverprofile=coverage.txt -covermode=atomic ./...
go test -tags=nomusl -race -coverprofile=coverage.txt -covermode=atomic ./...
- upload_codecov: { flags: unit }

store-local-testcontainer:
Expand Down Expand Up @@ -667,7 +667,7 @@ jobs:
name:
command: |
go install github.com/google/go-containerregistry/cmd/gcrane@latest
pip install -U pip nox requests
pip install -U pip nox requests uv
nox -s local-testcontainer-registry
no_output_timeout: 5m

Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/release-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,8 @@ jobs:
# In cp36-*, the wheel name sometimes includes additional dashes that
# make it invalid, breaking the job.
#
# Not sure why we skip PyPy and musllinux builds.
#
# See https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip
CIBW_SKIP: cp36-* pp* *musllinux*
CIBW_SKIP: pp* *manylinux*
CIBW_ARCHS_LINUX: x86_64 aarch64
CIBW_ARCHS_MACOS: x86_64 arm64 # arm64 == aarch64

Expand All @@ -141,9 +139,12 @@ jobs:
esac &&
export DOWNLOAD_GOVERSION=$( grep '^go' core/go.mod | cut -d' ' -f2 ) &&
curl -L https://golang.org/dl/go$DOWNLOAD_GOVERSION.linux-$DOWNLOAD_GOARCH.tar.gz > go.tar.gz &&
tar -C /usr/local/ -xzf go.tar.gz
tar -C /usr/local/ -xzf go.tar.gz &&
env
CIBW_ENVIRONMENT_LINUX:
PATH=$PATH:/usr/local/go/bin
# TODO: fixme
CIBW_REPAIR_WHEEL_COMMAND_LINUX: ""

- uses: actions/upload-artifact@v3
with:
Expand Down
9 changes: 9 additions & 0 deletions core/hatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@ def build_wandb_core(
is the https://github.com/wandb/wandb repository. Otherwise, an
empty string.
"""
print(os.environ)
coverage_flags = ["-cover"] if with_code_coverage else []
# TODO: the musl tag is used to skip building nvidia gpu monitoring on musl-based systems
musl_tag = [
"-tags",
"musl"
if os.environ.get("AUDITWHEEL_PLAT", "").startswith("musl")
else "nomusl",
]
output_flags = ["-o", str(".." / output_path)]
ld_flags = [f"-ldflags={_go_linker_flags(wandb_commit_sha)}"]

Expand All @@ -35,6 +43,7 @@ def build_wandb_core(
[
str(go_binary),
"build",
*musl_tag,
*coverage_flags,
*ld_flags,
*output_flags,
Expand Down
30 changes: 0 additions & 30 deletions core/pkg/monitor/noop.go → core/pkg/monitor/gpu_amd_noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,6 @@ import (
"github.com/wandb/wandb/core/pkg/service"
)

type GPUNvidia struct {
name string
settings *service.Settings
}

func NewGPUNvidia(settings *service.Settings) *GPUNvidia {
gpu := &GPUNvidia{
name: "gpu",
settings: settings,
}

return gpu
}

func (g *GPUNvidia) Name() string { return g.name }

func (g *GPUNvidia) SampleMetrics() {}

func (g *GPUNvidia) AggregateMetrics() map[string]float64 {
return map[string]float64{}
}

func (g *GPUNvidia) ClearMetrics() {}

func (g *GPUNvidia) IsAvailable() bool { return false }

func (g *GPUNvidia) Probe() *service.MetadataRequest {
return nil
}

type GPUAMD struct {
name string
settings *service.Settings
Expand Down
2 changes: 1 addition & 1 deletion core/pkg/monitor/gpu_nvidia.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build linux && !libwandb_core
//go:build linux && nomusl && !libwandb_core

package monitor

Expand Down
37 changes: 37 additions & 0 deletions core/pkg/monitor/gpu_nvidia_noop.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//go:build !linux || (linux && musl) || libwandb_core

package monitor

import (
"github.com/wandb/wandb/core/pkg/service"
)

type GPUNvidia struct {
name string
settings *service.Settings
}

func NewGPUNvidia(settings *service.Settings) *GPUNvidia {
gpu := &GPUNvidia{
name: "gpu",
settings: settings,
}

return gpu
}

func (g *GPUNvidia) Name() string { return g.name }

Check warning on line 23 in core/pkg/monitor/gpu_nvidia_noop.go

View check run for this annotation

Codecov / codecov/patch

core/pkg/monitor/gpu_nvidia_noop.go#L23

Added line #L23 was not covered by tests

func (g *GPUNvidia) SampleMetrics() {}

Check warning on line 25 in core/pkg/monitor/gpu_nvidia_noop.go

View check run for this annotation

Codecov / codecov/patch

core/pkg/monitor/gpu_nvidia_noop.go#L25

Added line #L25 was not covered by tests

func (g *GPUNvidia) AggregateMetrics() map[string]float64 {
return map[string]float64{}

Check warning on line 28 in core/pkg/monitor/gpu_nvidia_noop.go

View check run for this annotation

Codecov / codecov/patch

core/pkg/monitor/gpu_nvidia_noop.go#L27-L28

Added lines #L27 - L28 were not covered by tests
}

func (g *GPUNvidia) ClearMetrics() {}

Check warning on line 31 in core/pkg/monitor/gpu_nvidia_noop.go

View check run for this annotation

Codecov / codecov/patch

core/pkg/monitor/gpu_nvidia_noop.go#L31

Added line #L31 was not covered by tests

func (g *GPUNvidia) IsAvailable() bool { return false }

func (g *GPUNvidia) Probe() *service.MetadataRequest {
return nil

Check warning on line 36 in core/pkg/monitor/gpu_nvidia_noop.go

View check run for this annotation

Codecov / codecov/patch

core/pkg/monitor/gpu_nvidia_noop.go#L35-L36

Added lines #L35 - L36 were not covered by tests
}