#python wheels
1 messages · Page 1 of 1 (latest)
@red birch hoping this helps a bit.
package rentalsapi
import (
"dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/docker"
)
dagger.#Plan & {
client: filesystem: ".build/": write: contents: actions.buildWheels.sub.output
_base: core.#Source & {
path: "."
}
actions: {
makeBuilder: docker.#Pull & {source: "alpine:3"}
buildWheels: {
read: core.#ReadFile & {
input: _base.output
path: "./Dockerfile.build"
}
run: docker.#Run & {
input: makeBuilder.output
always: true
workdir: "/rentals/api/src/Rentals-API"
command: {
name: "sh"
args: ["-c", "mkdir -p .build && echo '\(read.contents)' > .build/requirements.txt && ls -al .build"]
}
}
sub: core.#Subdir & {
input: actions.buildWheels.run.output.rootfs
path: "/rentals/api/src/Rentals-API/.build"
}
}
}
}
You'll notice that to write to the client (laptop/CI server/etc) we use client: filesystem: ".build/": write: contents: where the contents are the result of an action: actions.buildWheels.sub.output
Also, as you did in your example, you can use core.#Source to get at things in the same directory and lower as your Dagger plan. Good for getting at a Dockerfile for example.
I have a very small one and grab it and echo it out into the .build/requirements.txt for an example since I don't have poetry etc running since I didn't build an image, but cheated and just pulled one (alpine:3).
$ rm -r .build
$ cat Dockerfile.build
FROM alpine
$ dagger do buildWheels --log-format plain --log-level debug
...
$ cat .build/requirements.txt
FROM alpine
educating myself: https://realpython.com/python-wheels/
@red birch wondering about cli.#Load. Do you need to load the builder image into your local Docker daemon in order to build your wheels? Or could you just build them in your Dagger plan?