Sandip Viradiya
09/23/2021, 6:48 AMSTORAGE = Bitbucket(
project="PrefectDemoECS", # name of project
repo="prefect", # name of repo in project
path="demo.py", # location of flow file in repo
workspace="sandipviradiya",
cloud_username_secret="bb_username",
cloud_app_password_secret="bb_app_password"
)
It is showing me the 404 error as the given image.
I checked the code https://github.com/PrefectHQ/prefect/blob/a2025983352d7e152da88358c3e578f3ce73778a/src/prefect/storage/bitbucket.py#L29 and it seems it is not selecting the Bitbucket cloud function and trying the Bitbucket server fetch only.
Any guidance will be really helpful.Kevin Kho
cloud_username_secret
and cloud_app_passwork_secret
the names of Prefect Secrets stored in the Cloud? Or are you passing the value as a string directly?Sandip Viradiya
09/23/2021, 11:14 PMcloud_username_secret
and cloud_app_passwork_secret
are cloud secrets. We just need to pass the name of the secrets as per the documentation. The main part is, it is not going in cloud code it self it seems. I dig into the Prefect code and if we have passed workspace
it should go to cloud code instead of the server code to fetch the Bitbucket flow. You can refer the image attached. It is not getting the Bitbucket path right. If you see the Bitbucket URL, it is the server code it is trying to fetch. If it goes in Cloud code it should show workspace name where it is trying to fetch the Bitbucket flow from (as per the Prefect code https://github.com/PrefectHQ/prefect/blob/a2025983352d7e152da88358c3e578f3ce73778a/src/prefect/storage/bitbucket.py#L29 ).
ThanksKevin Kho
Sandip Viradiya
09/24/2021, 2:36 AMSandip Viradiya
09/24/2021, 2:37 AMSandip Viradiya
09/24/2021, 3:14 AMKevin Kho
Sandip Viradiya
09/24/2021, 5:19 AMtarget="hardcore.bytes"
RESULT = S3Result(
bucket='prefect-cache',
location=target,
boto3_kwargs=dict(
aws_access_key_id=Secret("aws_access_key_id").get(),
aws_secret_access_key=Secret("aws_secret_access_key").get(),
#endpoint_url=os.getenv("AWS_S3_ENDPOINT"),
)
)
@task
def hi():
logger = prefect.context.get('logger')
<http://logger.info|logger.info>("Hello S3Result !")
with Flow("prefect-dask-bb-result", storage=STORAGE, run_config=RUN_CONFIG, executor=EXECUTOR, result=RESULT) as flow:
hi()
The strange part is, I can not see anything in the task log. It shows everything from Task submitted to Bitbucket code fetch to Success. As per the code of S3Result, https://github.com/PrefectHQ/prefect/blob/a2025983352d7e152da88358c3e578f3ce73778a/src/prefect/engine/results/s3_result.py it should show me the file upload in the log. That means it is not trying to save the result on S3Result. Am I missing something?
Thanks in advance. 🍻Kevin Kho
hi
task? What happens if you return 1
Kevin Kho