Joseph Loss
07/06/2021, 5:34 PMKevin Kho
aws ecr get-login-password
to authenticate the gent. See this under the Create storage for flows with ECR
section. And then you would use CodeCommit for Storage (and provide the credentials to that) + ECR in the RunConfig. What have you tried so far?Joseph Loss
07/06/2021, 7:33 PMKevin Kho
Joseph Loss
07/06/2021, 7:34 PMwith Flow('Test DockerRun Configuration',
run_config = DockerRun(
image = 'my_aws_image,
labels = ['sradocker'],
secrets=["AWS_CREDENTIALS"]
),
storage = CodeCommit(
repo = 'advisorscodebase',
path = 'InvestmentManagement/test_docker.py',
commit = 'srockjoe',
secrets = ["AWS_CREDENTIALS"],
client_options = { "region_name":"us-east-2" }
)
) as flow:
Kevin Kho
flow.run_config = DockerRun(env={"SOME_VAR": "value"})
Joseph Loss
07/06/2021, 7:36 PMJoseph Loss
07/06/2021, 7:37 PMKevin Kho
Joseph Loss
07/06/2021, 7:37 PMJoseph Loss
07/06/2021, 7:37 PMJoseph Loss
07/06/2021, 7:37 PMKevin Kho
Joseph Loss
07/06/2021, 7:38 PMJoseph Loss
07/06/2021, 7:38 PMJoseph Loss
07/06/2021, 7:40 PMKevin Kho
Joseph Loss
07/06/2021, 7:47 PM[2021-07-06 19:31:32,919] INFO - agent | Deploying flow run 5b13f589-39d9-483f-89f9-9c4f8dc81ea5 to execution environment...
[2021-07-06 19:31:33,082] INFO - agent | Pulling image <http://393312900658.dkr.ecr.us-east-2.amazonaws.com/py38_prefect:latest|393312900658.dkr.ecr.us-east-2.amazonaws.com/py38_prefect:latest>...
[2021-07-06 19:31:33,330] INFO - agent | Successfully pulled image <http://393312900658.dkr.ecr.us-east-2.amazonaws.com/py38_prefect:latest|393312900658.dkr.ecr.us-east-2.amazonaws.com/py38_prefect:latest>
[2021-07-06 19:31:34,722] INFO - agent | Completed deployment of flow run 5b13f589-39d9-483f-89f9-9c4f8dc81ea5
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.10.1
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
No module named 'boto3'
c:\program files (x86)\python38-32\lib\site-packages\prefect\client\client.py:170: UserWarning: Client was created with an API token configured for authentication. API tokens are deprecated, please use API keys instead.
warnings.warn(
Traceback (most recent call last):
File "c:\program files (x86)\python38-32\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\program files (x86)\python38-32\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Program Files (x86)\Python38-32\Scripts\prefect.exe\__main__.py", line 7, in <module>
File "c:\program files (x86)\python38-32\lib\site-packages\click\core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "c:\program files (x86)\python38-32\lib\site-packages\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "c:\program files (x86)\python38-32\lib\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\program files (x86)\python38-32\lib\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\program files (x86)\python38-32\lib\site-packages\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\program files (x86)\python38-32\lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "c:\program files (x86)\python38-32\lib\site-packages\prefect\cli\execute.py", line 96, in flow_run
raise exc
File "c:\program files (x86)\python38-32\lib\site-packages\prefect\cli\execute.py", line 73, in flow_run
flow = storage.get_flow(flow_data.name)
File "c:\program files (x86)\python38-32\lib\site-packages\prefect\storage\codecommit.py", line 70, in get_flow
client = self._boto3_client
File "c:\program files (x86)\python38-32\lib\site-packages\prefect\storage\codecommit.py", line 117, in _boto3_client
from prefect.utilities.aws import get_boto_client
File "c:\program files (x86)\python38-32\lib\site-packages\prefect\utilities\aws.py", line 10, in <module>
import boto3
ModuleNotFoundError: No module named 'boto3'
Joseph Loss
07/06/2021, 7:48 PMKevin Kho
Joseph Loss
07/06/2021, 7:51 PMJoseph Loss
07/06/2021, 7:51 PMCOPY requirements.txt /requirements.txt
COPY sralib sralib
RUN pip install -U pip setuptools wheel
RUN pip install prefect[github] prefect[aws]
RUN pip install -r "requirements.txt"
# && pip install ipykernel ipython-genutils ipython ipywidgets jupyter-client jupyter-console jupyter-core jupyter-server jupyterlab jupyter jupyterlab-pygments jupyterlab-server jupyterlab-widgets;
# RUN pip install nbclassic nbclient nbconvert nbformat notebook
WORKDIR sralib
RUN python setup.py sdist bdist_wheel
WORKDIR dist
RUN python -m pip install sraPy-2.0.1-py3-none-any.whl;
# Define the entry point for the docker container.
# This entry point starts the developer command prompt and launches the PowerShell shell.
ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
# ENTRYPOINT ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
Kevin Kho
Joseph Loss
07/06/2021, 7:57 PMJoseph Loss
07/06/2021, 7:58 PMKevin Kho
Kevin Kho
Joseph Loss
07/06/2021, 8:08 PMKevin Kho
Kevin Kho
Joseph Loss
07/06/2021, 8:23 PMJoseph Loss
07/06/2021, 9:14 PMJoseph Loss
07/06/2021, 9:14 PMKevin Kho
Joseph Loss
07/07/2021, 2:16 PM