Build the nightly docker with remote BuildKit on OSDC
An OSDC runner has no host docker daemon, so `docker build`, `docker tag` and
`docker push` all fail there. OSDC instead runs a per-architecture buildkitd in
every cluster; test-infra's docker-build-remote-buildkit action registers it as
a remote buildx builder and retries the connect-phase failures a cold pool
produces.
Recovering the dev<date> tag is the part that does not port directly. It came
from `docker run`-ing the freshly built image and importing torch, which needs
the daemon. Instead the Dockerfile now writes the version into the image and a
scratch `version-export` stage exposes just that file, so buildx can export it
with --output type=local. A trailing `FROM base AS image` keeps the default
build target the real image rather than the scratch stage, so a plain
`docker build` still behaves.
That does mean two buildx calls. They are cached against a registry
:buildcache, since the pool can hand out a different builder each time and the
second call must not rebuild install.py from scratch.
Also:
- `path:` under pull_request was a typo for `paths:`. GitHub ignores unknown
keys, so the filter never applied and this build ran on every PR.
- Dropped the workflow-level HUGGING_FACE_HUB_TOKEN. `docker build` cannot see
host environment without --build-arg or --secret, so it was never reaching
the build.
- linux.4xlarge -> mt-l-x86iavx512-16-128 per pytorch/pytorch .github/arc.yaml,
though the runner now only ships the context and waits; the build itself
happens on buildkitd.
Authored with Claude Code.