Madison Schott
08/09/2021, 2:55 PMKevin Kho
Madison Schott
08/09/2021, 3:07 PMKevin Kho
Madison Schott
08/09/2021, 3:18 PMMadison Schott
08/09/2021, 9:36 PMKevin Kho
Madison Schott
08/09/2021, 9:44 PMKevin Kho
Madison Schott
08/09/2021, 9:46 PMRUN_CONFIG = ECSRun(run_task_kwargs={'cluster': 'prefect-prod'},
execution_role_arn='---',
labels=['ecs', 'test', 'hello', 'august'])
Kevin Kho
Madison Schott
08/09/2021, 9:53 PMKevin Kho
PREFECT___LOGGING___LEVEL
with value DEBUG
or you can do it on agent spin up using the --env
flag.Madison Schott
08/09/2021, 10:41 PMKevin Kho
Madison Schott
08/09/2021, 10:43 PMMadison Schott
08/09/2021, 10:43 PMKevin Kho
ECSRun(env={"PREFECT___LOGGING___LEVEL": "DEBUG"}
and then re-register and run?Kevin Kho
prefect agent ecs start --env PREFECT___LOGGING___LEVEL=DEBUG
Madison Schott
08/09/2021, 11:45 PMKevin Kho
Madison Schott
08/09/2021, 11:49 PM3b874891-5938-4e19-af8b-213341e5cc78
Kevin Kho
Madison Schott
08/09/2021, 11:59 PMMadison Schott
08/09/2021, 11:59 PMKevin Kho
Kevin Kho
Madison Schott
08/10/2021, 2:37 PMAGENT = ECSAgent(cluster="prefect-prod", labels=['ecs', 'test', 'hello', 'august'])
AGENT.start()
Madison Schott
08/10/2021, 2:37 PMKevin Kho
env_vars={}
argument of the ECS AgentMadison Schott
08/10/2021, 2:59 PMKevin Kho
Madison Schott
08/10/2021, 3:00 PMarn:aws:iam::xxxxxxx:role/xxx
Kevin Kho
Madison Schott
08/10/2021, 3:03 PMMadison Schott
08/10/2021, 3:03 PMKevin Kho
Madison Schott
08/10/2021, 3:07 PMKevin Kho
J. Martins
08/10/2021, 4:04 PMMadison Schott
08/10/2021, 4:19 PMMadison Schott
08/10/2021, 4:20 PMResourceInitializationError: unable to pull secrets or registry auth: execution resource retrieval failed: unable to retrieve ecr registry auth: service call has been retried 1 time(s): AccessDeniedException: User:
Madison Schott
08/10/2021, 4:20 PMKevin Kho
aws ecr get-login-password --region <REGION> | docker login -- username AWS --password-stdin <ACCOUNT>.dkr.ecr.<REGION>.<http://amazonaws.com|amazonaws.com>
Is your ecs agent running as a service on AWS too?Madison Schott
08/10/2021, 4:23 PMKevin Kho
Madison Schott
08/10/2021, 4:24 PMMariia Kerimova
08/10/2021, 4:28 PMAmazonECSTaskExecutionRolePolicy
?Madison Schott
08/11/2021, 2:40 PMKevin Kho
Madison Schott
08/11/2021, 2:44 PMMadison Schott
08/11/2021, 2:46 PMKevin Kho
yml
. If you are trying to include other Python dependencies, that should be a Docker container.
Git storage lets you keep some of these static files, but you need to use them outside the tasks because the repo is cloned, and then deleted after reading in those stuff. In your case with dbt attached to the shell task, it might not work.
The Docker container lets you pip install
modules inside compared to using Git storage. You can also include stuff like R or C or Java, stuff outside Python needed to run Flows in the container.
There are two ways you can do this I think. First is you can add the dbt
dependencies to the container that you put in ECR. And then you can run the flow on top of that (DockerRun + Github Storage), it might be a bit harder this way to get that paths working this way. If you use Docker storage though, I think the paths are easier to resolve because you specify the WORKDIR
. You would just add the files to the container like this .Madison Schott
08/11/2021, 8:31 PMKevin Kho
Madison Schott
08/11/2021, 8:34 PMMadison Schott
08/11/2021, 8:34 PMKevin Kho
Kevin Kho
Madison Schott
08/11/2021, 8:38 PM# specify a base image
FROM python:3-slim
# copy all folder contents to the image
COPY . .
# install all dependencies
RUN pip install -r requirements.txt
ADD ~./.dbt/profiles.yml
Madison Schott
08/11/2021, 8:39 PMKevin Kho
prefecthq:prefect
. I think you want two COPY commands. First for the files you have. Second for the .dbt
folder. I would also COPY it into .dbt
in the container because that’s where the files will be looked for by dbt
But yes it’s something like this. My advice is just to try this and then even before going to prefect, you could try building the container from the dockerfile and going inside to check if the .dbt
folder made it right, and then try running the dbt
commands before registering the flow.Madison Schott
08/11/2021, 8:45 PMKevin Kho
FROM prefecthq:prefect
Madison Schott
08/11/2021, 8:47 PMKevin Kho
Madison Schott
08/11/2021, 8:51 PM# specify a base image
FROM prefecthq:prefect
# copy all folder contents to the image
COPY ~./.dbt/profiles.yml
COPY /Users/madison/dbt_snowflake
# install all dependencies
RUN pip install -r requirements.txt
Madison Schott
08/11/2021, 8:51 PMKevin Kho
Madison Schott
08/11/2021, 8:57 PMStep 1/12 : FROM prefecthq:prefect
pull access denied for prefecthq, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
Kevin Kho
FROM prefecthq/prefect:0.14.14-python3.7
Kevin Kho
FROM prefecthq/prefect:latest
. This will workMadison Schott
08/11/2021, 9:04 PMCOPY failed: file not found in build context or excluded by .dockerignore: stat ~.dbt/profiles.yml: file does not exist
Madison Schott
08/11/2021, 9:07 PMKevin Kho
Kevin Kho
RUN ["mv", "…"]
does that make sense?Madison Schott
08/11/2021, 9:20 PMKevin Kho
Kevin Kho
Madison Schott
08/11/2021, 9:27 PMMadison Schott
08/11/2021, 9:27 PMKevin Kho
Madison Schott
08/11/2021, 9:30 PMKevin Kho
Madison Schott
08/11/2021, 9:33 PMMadison Schott
08/11/2021, 9:33 PMKevin Kho
.dbt
files are in the home directory right? Not in the current directory?Madison Schott
08/11/2021, 9:51 PMMadison Schott
08/11/2021, 9:51 PMKevin Kho
Madison Schott
08/12/2021, 2:44 PMMadison Schott
08/12/2021, 2:44 PMKevin Kho
Madison Schott
08/12/2021, 2:58 PMKevin Kho
Kevin Kho
Madison Schott
08/12/2021, 5:29 PMprofiles_dir='/Users/madisonschott/.dbt'
which is within the dbt task is also what's causing the issueMadison Schott
08/12/2021, 5:29 PMdbt_task = DbtShellTask(profile_name='winc',
log_stderr=True,
environment='dev',
dbt_kwargs = {
},
profiles_dir='/Users/madisonschott/.dbt')
Madison Schott
08/12/2021, 5:30 PMMadison Schott
08/12/2021, 9:09 PMMadison Schott
08/12/2021, 9:10 PMKevin Kho
Madison Schott
08/12/2021, 9:28 PMKevin Kho
Madison Schott
08/12/2021, 10:06 PMMadison Schott
08/12/2021, 10:17 PMKevin Kho
Madison Schott
08/12/2021, 10:20 PM