stdlib: add random package

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2021-06-08 11:46:31 -07:00
parent 4c40a87634
commit db0937c927
24 changed files with 152 additions and 580 deletions

69
stdlib/random/string.cue Normal file
View File

@ -0,0 +1,69 @@
// Random generation utilities.
//
// Example:
// ```
// str: random.#String & {
// seed: "str"
// length: 10
// }
// ```
package random
import (
"strconv"
"dagger.io/alpine"
"dagger.io/dagger/op"
)
// Generate a random string
#String: {
// Seed of the random string to generate.
// When using the same `seed`, the same random string will be generated
// because of caching.
// FIXME: this is necessary because of https://github.com/dagger/dagger/issues/591
seed: string @dagger(input)
// length of the string
length: *12 | number @dagger(input)
// generated random string
out: {
string
#up: [
op.#Load & {from: alpine.#Image & {
package: python3: "=~3.8"
}},
op.#WriteFile & {
dest: "/entrypoint.py"
content: #"""
import random
import string
import os
length = int(os.environ['LENGTH'])
letters = string.ascii_lowercase
print ( ''.join(random.choice(letters) for i in range(length)) )
"""#
},
op.#Exec & {
args: ["sh", "-c", #"""
printf "$(python3 /entrypoint.py)" > /rand
"""#,
]
env: LENGTH: strconv.FormatInt(length, 10)
env: SEED: seed
always: true
},
op.#Export & {
source: "/rand"
},
]
} @dagger(output)
}

View File

@ -3,6 +3,7 @@ package main
import ( import (
"dagger.io/dagger/op" "dagger.io/dagger/op"
"dagger.io/alpine" "dagger.io/alpine"
"dagger.io/random"
) )
registry: { registry: {
@ -11,15 +12,19 @@ registry: {
} }
TestPushContainer: { TestPushContainer: {
tag: random.#String & {
seed: "push-container"
}
// Push an image with a random tag // Push an image with a random tag
push: { push: {
ref: "daggerio/ci-test:\(random)" ref: "daggerio/ci-test:\(tag.out)"
#up: [ #up: [
op.#DockerLogin & { op.#DockerLogin & {
registry registry
}, },
op.#WriteFile & { op.#WriteFile & {
content: random content: tag.out
dest: "/rand" dest: "/rand"
}, },
op.#PushContainer & { op.#PushContainer & {
@ -41,7 +46,7 @@ TestPushContainer: {
op.#Exec & { op.#Exec & {
args: [ args: [
"sh", "-c", #""" "sh", "-c", #"""
test "$(cat /src/rand)" = "\#(random)" test "$(cat /src/rand)" = "\#(tag.out)"
"""#, """#,
] ]
mount: "/src": from: pull mount: "/src": from: pull
@ -51,14 +56,18 @@ TestPushContainer: {
// Ensures image metadata is preserved in a push // Ensures image metadata is preserved in a push
TestPushContainerMetadata: { TestPushContainerMetadata: {
tag: random.#String & {
seed: "container-metadata"
}
// `docker build` using an `ENV` and push the image // `docker build` using an `ENV` and push the image
push: { push: {
ref: "daggerio/ci-test:\(random)-dockerbuild" ref: "daggerio/ci-test:\(tag.out)-dockerbuild"
#up: [ #up: [
op.#DockerBuild & { op.#DockerBuild & {
dockerfile: #""" dockerfile: #"""
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
ENV CHECK \#(random) ENV CHECK \#(tag.out)
"""# """#
}, },
op.#PushContainer & { op.#PushContainer & {
@ -76,7 +85,7 @@ TestPushContainerMetadata: {
args: [ args: [
"sh", "-c", #""" "sh", "-c", #"""
env env
test "$CHECK" = "\#(random)" test "$CHECK" = "\#(tag.out)"
"""#, """#,
] ]
}, },
@ -85,7 +94,7 @@ TestPushContainerMetadata: {
// Do a FetchContainer followed by a PushContainer, make sure // Do a FetchContainer followed by a PushContainer, make sure
// the ENV is preserved // the ENV is preserved
pullPush: { pullPush: {
ref: "daggerio/ci-test:\(random)-pullpush" ref: "daggerio/ci-test:\(tag.out)-pullpush"
#up: [ #up: [
op.#FetchContainer & { op.#FetchContainer & {
@ -104,7 +113,7 @@ TestPushContainerMetadata: {
op.#Exec & { op.#Exec & {
args: [ args: [
"sh", "-c", #""" "sh", "-c", #"""
test "$CHECK" = "\#(random)" test "$CHECK" = "\#(tag.out)"
"""#, """#,
] ]
}, },

View File

@ -1,49 +0,0 @@
package main
import (
"strconv"
"dagger.io/alpine"
"dagger.io/dagger/op"
)
#Random: {
size: *12 | number
out: {
string
#up: [
op.#Load & {from: alpine.#Image & {
package: python3: "=~3.8"
}},
op.#WriteFile & {
dest: "/entrypoint.py"
content: #"""
import random
import string
import os
size = int(os.environ['SIZE'])
letters = string.ascii_lowercase
print ( ''.join(random.choice(letters) for i in range(size)) )
"""#
},
op.#Exec & {
always: true
args: ["sh", "-c", #"""
printf "$(python3 /entrypoint.py)" > /rand
"""#,
]
env: SIZE: strconv.FormatInt(size, 10)
},
op.#Export & {
source: "/rand"
},
]
}
}

View File

@ -4,6 +4,7 @@ import (
"dagger.io/aws" "dagger.io/aws"
"dagger.io/aws/ecr" "dagger.io/aws/ecr"
"dagger.io/dagger/op" "dagger.io/dagger/op"
"dagger.io/random"
) )
TestConfig: awsConfig: aws.#Config & { TestConfig: awsConfig: aws.#Config & {
@ -11,10 +12,12 @@ TestConfig: awsConfig: aws.#Config & {
} }
TestECR: { TestECR: {
random: #Random & {} suffix: random.#String & {
seed: ""
}
repository: "125635003186.dkr.ecr.\(TestConfig.awsConfig.region).amazonaws.com/dagger-ci" repository: "125635003186.dkr.ecr.\(TestConfig.awsConfig.region).amazonaws.com/dagger-ci"
tag: "test-ecr-\(random.out)" tag: "test-ecr-\(suffix.out)"
creds: ecr.#Credentials & { creds: ecr.#Credentials & {
config: TestConfig.awsConfig config: TestConfig.awsConfig
@ -27,7 +30,7 @@ TestECR: {
op.#DockerBuild & { op.#DockerBuild & {
dockerfile: """ dockerfile: """
FROM alpine FROM alpine
RUN echo \(random.out) > /test RUN echo \(suffix.out) > /test
""" """
}, },
@ -63,7 +66,7 @@ TestECR: {
op.#Exec & { op.#Exec & {
always: true always: true
args: [ args: [
"sh", "-c", "test $(cat test) = \(random.out)", "sh", "-c", "test $(cat test) = \(suffix.out)",
] ]
}, },
] ]
@ -78,7 +81,7 @@ TestECR: {
op.#DockerBuild & { op.#DockerBuild & {
dockerfile: #""" dockerfile: #"""
FROM \#(push.ref) FROM \#(push.ref)
RUN test $(cat test) = \#(random.out) RUN test $(cat test) = \#(suffix.out)
"""# """#
}, },
] ]

View File

@ -1,49 +0,0 @@
package main
import (
"strconv"
"dagger.io/alpine"
"dagger.io/dagger/op"
)
#Random: {
size: *12 | number
out: {
string
#up: [
op.#Load & {from: alpine.#Image & {
package: python3: "=~3.8"
}},
op.#WriteFile & {
dest: "/entrypoint.py"
content: #"""
import random
import string
import os
size = int(os.environ['SIZE'])
letters = string.ascii_lowercase
print ( ''.join(random.choice(letters) for i in range(size)) )
"""#
},
op.#Exec & {
always: true
args: ["sh", "-c", #"""
printf "$(python3 /entrypoint.py)" > /rand
"""#,
]
env: SIZE: strconv.FormatInt(size, 10)
},
op.#Export & {
source: "/rand"
},
]
}
}

View File

@ -5,6 +5,7 @@ import (
"dagger.io/dagger/op" "dagger.io/dagger/op"
"dagger.io/alpine" "dagger.io/alpine"
"dagger.io/docker" "dagger.io/docker"
"dagger.io/random"
) )
source: dagger.#Artifact source: dagger.#Artifact
@ -15,9 +16,11 @@ registry: {
} }
TestPushAndPull: { TestPushAndPull: {
random: #Random & {} tag: random.#String & {
seed: ""
}
ref: "daggerio/ci-test:\(random.out)" ref: "daggerio/ci-test:\(tag.out)"
// Create image // Create image
image: docker.#ImageFromDockerfile & { image: docker.#ImageFromDockerfile & {

View File

@ -1,49 +0,0 @@
package main
import (
"strconv"
"dagger.io/alpine"
"dagger.io/dagger/op"
)
#Random: {
size: *12 | number
out: {
string
#up: [
op.#Load & {from: alpine.#Image & {
package: python3: "=~3.8"
}},
op.#WriteFile & {
dest: "/entrypoint.py"
content: #"""
import random
import string
import os
size = int(os.environ['SIZE'])
letters = string.ascii_lowercase
print ( ''.join(random.choice(letters) for i in range(size)) )
"""#
},
op.#Exec & {
always: true
args: ["sh", "-c", #"""
printf "$(python3 /entrypoint.py)" > /rand
"""#,
]
env: SIZE: strconv.FormatInt(size, 10)
},
op.#Export & {
source: "/rand"
},
]
}
}

View File

@ -3,13 +3,16 @@ package main
import ( import (
"dagger.io/docker" "dagger.io/docker"
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/random"
) )
TestRun: { TestRun: {
random: #Random & {} suffix: random.#String & {
seed: ""
}
run: docker.#Run & { run: docker.#Run & {
name: "daggerci-test-local-\(random.out)" name: "daggerci-test-local-\(suffix.out)"
ref: "hello-world" ref: "hello-world"
} }
} }

View File

@ -1,49 +0,0 @@
package main
import (
"strconv"
"dagger.io/alpine"
"dagger.io/dagger/op"
)
#Random: {
size: *12 | number
out: {
string
#up: [
op.#Load & {from: alpine.#Image & {
package: python3: "=~3.8"
}},
op.#WriteFile & {
dest: "/entrypoint.py"
content: #"""
import random
import string
import os
size = int(os.environ['SIZE'])
letters = string.ascii_lowercase
print ( ''.join(random.choice(letters) for i in range(size)) )
"""#
},
op.#Exec & {
always: true
args: ["sh", "-c", #"""
printf "$(python3 /entrypoint.py)" > /rand
"""#,
]
env: SIZE: strconv.FormatInt(size, 10)
},
op.#Export & {
source: "/rand"
},
]
}
}

View File

@ -3,6 +3,7 @@ package docker
import ( import (
"dagger.io/docker" "dagger.io/docker"
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/random"
) )
key: dagger.#Secret @dagger(input) key: dagger.#Secret @dagger(input)
@ -10,14 +11,16 @@ passphrase: dagger.#Secret @dagger(input)
user: string @dagger(input) user: string @dagger(input)
TestRun: { TestRun: {
random: #Random & {} suffix: random.#String & {
seed: ""
}
run: docker.#Run & { run: docker.#Run & {
host: "143.198.64.230" host: "143.198.64.230"
ref: "nginx:alpine" ref: "nginx:alpine"
"user": user "user": user
"passphrase": passphrase "passphrase": passphrase
name: "daggerci-test-simple-\(random.out)" name: "daggerci-test-simple-\(suffix.out)"
"key": key "key": key
} }
} }

View File

@ -3,6 +3,7 @@ package main
import ( import (
"dagger.io/docker" "dagger.io/docker"
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/random"
) )
TestConfig: { TestConfig: {
@ -13,11 +14,13 @@ TestConfig: {
} }
TestRun: { TestRun: {
random: #Random & {} suffix: random.#String & {
seed: ""
}
run: docker.#Run & { run: docker.#Run & {
ref: "hello-world" ref: "hello-world"
name: "daggerci-test-simple-\(random.out)" name: "daggerci-test-simple-\(suffix.out)"
ssh: { ssh: {
host: TestConfig.host host: TestConfig.host

View File

@ -1,49 +0,0 @@
package main
import (
"strconv"
"dagger.io/alpine"
"dagger.io/dagger/op"
)
#Random: {
size: *12 | number
out: {
string
#up: [
op.#Load & {from: alpine.#Image & {
package: python3: "=~3.8"
}},
op.#WriteFile & {
dest: "/entrypoint.py"
content: #"""
import random
import string
import os
size = int(os.environ['SIZE'])
letters = string.ascii_lowercase
print ( ''.join(random.choice(letters) for i in range(size)) )
"""#
},
op.#Exec & {
always: true
args: ["sh", "-c", #"""
printf "$(python3 /entrypoint.py)" > /rand
"""#,
]
env: SIZE: strconv.FormatInt(size, 10)
},
op.#Export & {
source: "/rand"
},
]
}
}

View File

@ -1,49 +0,0 @@
package main
import (
"strconv"
"dagger.io/alpine"
"dagger.io/dagger/op"
)
#Random: {
size: *12 | number
out: {
string
#up: [
op.#Load & {from: alpine.#Image & {
package: python3: "=~3.8"
}},
op.#WriteFile & {
dest: "/entrypoint.py"
content: #"""
import random
import string
import os
size = int(os.environ['SIZE'])
letters = string.ascii_lowercase
print ( ''.join(random.choice(letters) for i in range(size)) )
"""#
},
op.#Exec & {
always: true
args: ["sh", "-c", #"""
printf "$(python3 /entrypoint.py)" > /rand
"""#,
]
env: SIZE: strconv.FormatInt(size, 10)
},
op.#Export & {
source: "/rand"
},
]
}
}

View File

@ -3,6 +3,7 @@ package main
import ( import (
"dagger.io/docker" "dagger.io/docker"
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/random"
) )
TestConfig: { TestConfig: {
@ -13,10 +14,12 @@ TestConfig: {
} }
TestRun: { TestRun: {
random: #Random & {} suffix: random.#String & {
seed: ""
}
run: docker.#Run & { run: docker.#Run & {
name: "daggerci-test-simple-\(random.out)" name: "daggerci-test-simple-\(suffix.out)"
ref: "hello-world" ref: "hello-world"
ssh: { ssh: {

View File

@ -1,49 +0,0 @@
package main
import (
"strconv"
"dagger.io/alpine"
"dagger.io/dagger/op"
)
#Random: {
size: *12 | number
out: {
string
#up: [
op.#Load & {from: alpine.#Image & {
package: python3: "=~3.8"
}},
op.#WriteFile & {
dest: "/entrypoint.py"
content: #"""
import random
import string
import os
size = int(os.environ['SIZE'])
letters = string.ascii_lowercase
print ( ''.join(random.choice(letters) for i in range(size)) )
"""#
},
op.#Exec & {
always: true
args: ["sh", "-c", #"""
printf "$(python3 /entrypoint.py)" > /rand
"""#,
]
env: SIZE: strconv.FormatInt(size, 10)
},
op.#Export & {
source: "/rand"
},
]
}
}

View File

@ -3,6 +3,7 @@ package main
import ( import (
"dagger.io/docker" "dagger.io/docker"
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/random"
) )
TestConfig: { TestConfig: {
@ -11,13 +12,13 @@ TestConfig: {
key: dagger.#Secret @dagger(input) key: dagger.#Secret @dagger(input)
} }
key: dagger.#Secret @dagger(input)
TestSSH: { TestSSH: {
random: #Random & {} suffix: random.#String & {
seed: ""
}
run: docker.#Run & { run: docker.#Run & {
name: "daggerci-test-simple-\(random.out)" name: "daggerci-test-simple-\(suffix.out)"
ref: "hello-world" ref: "hello-world"
ssh: { ssh: {

View File

@ -4,15 +4,18 @@ import (
"dagger.io/gcp" "dagger.io/gcp"
"dagger.io/gcp/gcr" "dagger.io/gcp/gcr"
"dagger.io/dagger/op" "dagger.io/dagger/op"
"dagger.io/random"
) )
TestConfig: gcpConfig: gcp.#Config TestConfig: gcpConfig: gcp.#Config
TestGCR: { TestGCR: {
random: #Random & {} suffix: random.#String & {
seed: ""
}
repository: "gcr.io/dagger-ci/test" repository: "gcr.io/dagger-ci/test"
tag: "test-gcr-\(random.out)" tag: "test-gcr-\(suffix.out)"
creds: gcr.#Credentials & { creds: gcr.#Credentials & {
config: TestConfig.gcpConfig config: TestConfig.gcpConfig
@ -25,7 +28,7 @@ TestGCR: {
op.#DockerBuild & { op.#DockerBuild & {
dockerfile: """ dockerfile: """
FROM alpine FROM alpine
RUN echo \(random.out) > /test RUN echo \(suffix.out) > /test
""" """
}, },
@ -61,7 +64,7 @@ TestGCR: {
op.#Exec & { op.#Exec & {
always: true always: true
args: [ args: [
"sh", "-c", "test $(cat test) = \(random.out)", "sh", "-c", "test $(cat test) = \(suffix.out)",
] ]
}, },
] ]
@ -76,7 +79,7 @@ TestGCR: {
op.#DockerBuild & { op.#DockerBuild & {
dockerfile: #""" dockerfile: #"""
FROM \#(push.ref) FROM \#(push.ref)
RUN test $(cat test) = \#(random.out) RUN test $(cat test) = \#(suffix.out)
"""# """#
}, },
] ]

View File

@ -1,49 +0,0 @@
package main
import (
"strconv"
"dagger.io/alpine"
"dagger.io/dagger/op"
)
#Random: {
size: *12 | number
out: {
string
#up: [
op.#Load & {from: alpine.#Image & {
package: python3: "=~3.8"
}},
op.#WriteFile & {
dest: "/entrypoint.py"
content: #"""
import random
import string
import os
size = int(os.environ['SIZE'])
letters = string.ascii_lowercase
print ( ''.join(random.choice(letters) for i in range(size)) )
"""#
},
op.#Exec & {
always: true
args: ["sh", "-c", #"""
printf "$(python3 /entrypoint.py)" > /rand
"""#,
]
env: SIZE: strconv.FormatInt(size, 10)
},
op.#Export & {
source: "/rand"
},
]
}
}

View File

@ -3,6 +3,7 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/kubernetes/helm" "dagger.io/kubernetes/helm"
"dagger.io/random"
) )
// We assume that a kinD cluster is running locally // We assume that a kinD cluster is running locally
@ -11,11 +12,13 @@ kubeconfig: dagger.#Secret @dagger(input)
// Deploy user local chart // Deploy user local chart
TestHelmSimpleChart: { TestHelmSimpleChart: {
random: #Random & {} suffix: random.#String & {
seed: "simple"
}
// Deploy chart // Deploy chart
deploy: helm.#Chart & { deploy: helm.#Chart & {
name: "dagger-test-helm-simple-chart-\(random.out)" name: "dagger-test-helm-simple-chart-\(suffix.out)"
namespace: "dagger-test" namespace: "dagger-test"
"kubeconfig": kubeconfig "kubeconfig": kubeconfig
chartSource: dagger.#Artifact chartSource: dagger.#Artifact
@ -30,11 +33,13 @@ TestHelmSimpleChart: {
// Deploy remote chart // Deploy remote chart
TestHelmRepoChart: { TestHelmRepoChart: {
random: #Random & {} suffix: random.#String & {
seed: "repo"
}
// Deploy chart // Deploy chart
deploy: helm.#Chart & { deploy: helm.#Chart & {
name: "dagger-test-helm-repository-\(random.out)" name: "dagger-test-helm-repository-\(suffix.out)"
namespace: "dagger-test" namespace: "dagger-test"
"kubeconfig": kubeconfig "kubeconfig": kubeconfig
chart: "redis" chart: "redis"

View File

@ -1,49 +0,0 @@
package main
import (
"strconv"
"dagger.io/alpine"
"dagger.io/dagger/op"
)
#Random: {
size: *12 | number
out: {
string
#up: [
op.#Load & {from: alpine.#Image & {
package: python3: "=~3.8"
}},
op.#WriteFile & {
dest: "/entrypoint.py"
content: #"""
import random
import string
import os
size = int(os.environ['SIZE'])
letters = string.ascii_lowercase
print ( ''.join(random.choice(letters) for i in range(size)) )
"""#
},
op.#Exec & {
always: true
args: ["sh", "-c", #"""
printf "$(python3 /entrypoint.py)" > /rand
"""#,
]
env: SIZE: strconv.FormatInt(size, 10)
},
op.#Export & {
source: "/rand"
},
]
}
}

View File

@ -4,6 +4,7 @@ import (
"encoding/yaml" "encoding/yaml"
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/kubernetes" "dagger.io/kubernetes"
"dagger.io/random"
) )
// We assume that a kinD cluster is running locally // We assume that a kinD cluster is running locally
@ -11,13 +12,15 @@ import (
kubeconfig: dagger.#Secret @dagger(input) kubeconfig: dagger.#Secret @dagger(input)
TestKubeApply: { TestKubeApply: {
random: #Random & {} suffix: random.#String & {
seed: ""
}
// Pod spec // Pod spec
kubeSrc: { kubeSrc: {
apiVersion: "v1" apiVersion: "v1"
kind: "Pod" kind: "Pod"
metadata: name: "kube-test-\(random.out)" metadata: name: "kube-test-\(suffix.out)"
spec: { spec: {
restartPolicy: "Never" restartPolicy: "Never"
containers: [{ containers: [{

View File

@ -1,49 +0,0 @@
package main
import (
"strconv"
"dagger.io/alpine"
"dagger.io/dagger/op"
)
#Random: {
size: *12 | number
out: {
string
#up: [
op.#Load & {from: alpine.#Image & {
package: python3: "=~3.8"
}},
op.#WriteFile & {
dest: "/entrypoint.py"
content: #"""
import random
import string
import os
size = int(os.environ['SIZE'])
letters = string.ascii_lowercase
print ( ''.join(random.choice(letters) for i in range(size)) )
"""#
},
op.#Exec & {
always: true
args: ["sh", "-c", #"""
printf "$(python3 /entrypoint.py)" > /rand
"""#,
]
env: SIZE: strconv.FormatInt(size, 10)
},
op.#Export & {
source: "/rand"
},
]
}
}

View File

@ -4,15 +4,18 @@ import (
"dagger.io/dagger/op" "dagger.io/dagger/op"
"dagger.io/alpine" "dagger.io/alpine"
"dagger.io/netlify" "dagger.io/netlify"
"dagger.io/random"
) )
TestNetlify: { TestNetlify: {
random: #Random & {} data: random.#String & {
seed: ""
}
// Generate a website containing the random number // Generate a website containing the random number
html: #up: [ html: #up: [
op.#WriteFile & { op.#WriteFile & {
content: random.out content: data.out
dest: "index.html" dest: "index.html"
}, },
] ]
@ -40,7 +43,7 @@ TestNetlify: {
"pipefail", "pipefail",
"-c", "-c",
#""" #"""
test "$(curl \#(deploy.deployUrl))" = "\#(random.out)" test "$(curl \#(deploy.deployUrl))" = "\#(data.out)"
"""#, """#,
] ]
}, },

View File

@ -1,49 +0,0 @@
package main
import (
"strconv"
"dagger.io/alpine"
"dagger.io/dagger/op"
)
#Random: {
size: *12 | number
out: {
string
#up: [
op.#Load & {from: alpine.#Image & {
package: python3: "=~3.8"
}},
op.#WriteFile & {
dest: "/entrypoint.py"
content: #"""
import random
import string
import os
size = int(os.environ['SIZE'])
letters = string.ascii_lowercase
print ( ''.join(random.choice(letters) for i in range(size)) )
"""#
},
op.#Exec & {
always: true
args: ["sh", "-c", #"""
printf "$(python3 /entrypoint.py)" > /rand
"""#,
]
env: SIZE: strconv.FormatInt(size, 10)
},
op.#Export & {
source: "/rand"
},
]
}
}