Emil Østergaard
07/17/2022, 9:05 PM/api/blocks
endpoint.
In the 2.0b8 api I see endpoints for block schemas, block_types and block_document,
but as far as I can tell none of these create a block?
Through the UI, it is not possible to supply the necessary client_kwargs
and config_kwargs
.
Is this no longer possible, or am I misunderstanding something?
For reference I used a request like this:
PAYLOAD=$(cat <<EOF
{
"name": "minio",
"block_spec_id": ${FILE_STORAGE_ID},
"data": {
"base_path": "<s3://prefect-flows>",
"key_type": "hash",
"options": {
"use_ssl": false,
"key": "blablabla",
"secret": "blablabla",
"client_kwargs": {"endpoint_url": "<http://minio:9000>"},
"config_kwargs":{"signature_version": "s3v4"},
}
}
}
EOF
)
BLOCK_ID=$(echo -n "$PAYLOAD" | curl -vs -XPOST -H "Content-Type: application/json" <http://localhost:4200/api/blocks/> -d@- | jq -r '.id')
Anna Geller
07/17/2022, 11:00 PMEmil Østergaard
07/18/2022, 6:54 AMBasePath
and name
parameters, which I do not think are sufficient to hook up to minio.Anna Geller
07/18/2022, 10:53 AMfrom prefect import task, flow
from prefect import get_run_logger
from prefect.deployments import Deployment
from prefect.packaging import FilePackager
from prefect.filesystems import RemoteFileSystem
@task
def say_hi(user_name: str):
logger = get_run_logger()
<http://logger.info|logger.info>("Hello %s!", user_name)
@flow
def hello(user: str = "world"):
say_hi(user)
Deployment(
flow=hello,
name="s3_file_packager_with_remote_s3fs",
packager=FilePackager(
filesystem=RemoteFileSystem(basepath="<s3://prefect-orion/flows/>")
),
)
if __name__ == "__main__":
hello(user="from Slack")
Emil Østergaard
07/18/2022, 4:07 PM