avast / wanna-ml

Complete MLOps framework for Vertex-AI
MIT License
17 stars 3 forks source link

[Bug]: wanna using my idea directory, crashing on it #114

Closed racinmat closed 3 months ago

racinmat commented 3 months ago

Contact Details

No response

What happened?

Wanna trying to upload my .idea directory

wanna.yaml file

does not matter

wanna-ml CLI command

wanna job run --name wanna-heur-eml --profile adp-ai-test python -m wanna_heur_eml.core.run

Relevant log output

ℹ Building data docker image in GCP Cloud build
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ C:\Users\E10270\.conda\envs\wanna-heur-eml\lib\site-packages\wanna\cli\plugins\job_plugin.py:87  │
│ in run                                                                                           │
│                                                                                                  │
│    84 │   │   config = load_config_from_yaml(file, gcp_profile_name=profile_name)                │
│    85 │   │   workdir = pathlib.Path(file).parent.resolve()                                      │
│    86 │   │   job_service = JobService(config=config, workdir=workdir, version=version)          │
│ ❱  87 │   │   manifests = job_service.build(instance_name)                                       │
│    88 │   │   job_service.push(manifests, local=False)                                           │
│    89 │   │   JobService.run(                                                                    │
│    90 │   │   │   [str(p) for p in manifests], sync=sync, hp_params=hp_params, command_overrid   │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │          args = []                                                                           │ │
...
│ │          file = WindowsPath('wanna.yaml')                                                    │ │
│ │     hp_params = None                                                                         │ │
│ │ instance_name = 'wanna-heur-eml'                                                             │ │
│ │   job_service = <wanna.core.services.jobs.JobService object at 0x0000016029106F50>           │ │
│ │  profile_name = 'adp-ai-test'                                                                │ │
│ │          sync = False                                                                        │ │
│ │       version = 'dev'                                                                        │ │
│ │       workdir = WindowsPath('C:/Projects/others/wanna-heur-eml')                             │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Users\E10270\.conda\envs\wanna-heur-eml\lib\site-packages\wanna\core\services\jobs.py:86 in   │
│ build                                                                                            │
│                                                                                                  │
│    83 │   │   │   Job Manifests and associated local paths where those were built                │
│    84 │   │   """                                                                                │
│    85 │   │   instances = self._filter_instances_by_name(instance_name)                          │
│ ❱  86 │   │   return [self._build(instance) for instance in instances]                           │
│    87 │                                                                                          │
│    88 │   def push(self, manifests: List[Path], local: bool = False) -> PushResult:              │
│    89 │   │   return self.connector.push_artifacts(                                              │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ instance_name = 'wanna-heur-eml'                                                             │ │
│ │     instances = [                                                                            │ │
│ │                 │   TrainingCustomJobModel(                                                  │ │
│ │                 │   │   name='wanna-heur-eml',                                               │ │
│ │                 │   │   project_id='ppt-ctores-adp-ai-f6',                                   │ │
│ │                 │   │   zone='europe-west1-b',                                               │ │
│ │                 │   │   region='europe-west1',                                               │ │
│ │                 │   │   labels={                                                             │ │
│ │                 │   │   │   'wanna_project': 'wanna-heur-eml',                               │ │
│ │                 │   │   │   'wanna_project_version': '0__0__0',                              │ │
│ │                 │   │   │   'wanna_project_authors': 'brano-bosansky',                       │ │
│ │                 │   │   │   'author': 'matej-racinsky_at_gendigital-com'                     │ │
│ │                 │   │   },                                                                   │ │
│ │                 │   │   description=None,                                                    │ │
│ │                 │   │                                                                        │ │
│ │                 service_account='sa-wanna-heur-eml@ppt-ctores-adp-ai-f6.iam.gserviceaccount… │ │
│ │                 │   │                                                                        │ │
│ │                 network='projects/ppt-ctores-adp-ai-f6/global/networks/europe-west1-gw-netw… │ │
│ │                 │   │   bucket='wanna-heur-eml-test',                                        │ │
│ │                 │   │   tags=None,                                                           │ │
│ │                 │   │   metadata=None,                                                       │ │
│ │                 │   │   enable_web_access=True,                                              │ │
│ │                 │   │                                                                        │ │
│ │                 base_output_directory='gs://wanna-heur-eml-test/wanna-jobs/wanna-heur-eml/o… │ │
│ │                 │   │   tensorboard_ref=None,                                                │ │
│ │                 │   │   timeout_seconds=86400,                                               │ │
│ │                 │   │   encryption_spec=None,                                                │ │
│ │                 │   │   env_vars=None,                                                       │ │
│ │                 │   │   worker=WorkerPoolModel(                                              │ │
│ │                 │   │   │   python_package=None,                                             │ │
│ │                 │   │   │   container=ContainerModel(docker_image_ref='data', command=[]),   │ │
│ │                 │   │   │   args=[],                                                         │ │
│ │                 │   │   │   env=None,                                                        │ │
│ │                 │   │   │   machine_type='n1-standard-16',                                   │ │
│ │                 │   │   │   gpu=GPU(                                                         │ │
│ │                 │   │   │   │   count=1,                                                     │ │
│ │                 │   │   │   │   accelerator_type='NVIDIA_TESLA_T4',                          │ │
│ │                 │   │   │   │   install_gpu_driver=True                                      │ │
│ │                 │   │   │   ),                                                               │ │
│ │                 │   │   │   boot_disk=None,                                                  │ │
│ │                 │   │   │   replica_count=1                                                  │ │
│ │                 │   │   ),                                                                   │ │
│ │                 │   │   reduction_server=None                                                │ │
│ │                 │   )                                                                        │ │
│ │                 ]                                                                            │ │
│ │          self = <wanna.core.services.jobs.JobService object at 0x0000016029106F50>           │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Users\E10270\.conda\envs\wanna-heur-eml\lib\site-packages\wanna\core\services\jobs.py:86 in   │
│ <listcomp>                                                                                       │
│                                                                                                  │
│    83 │   │   │   Job Manifests and associated local paths where those were built                │
│    84 │   │   """                                                                                │
│    85 │   │   instances = self._filter_instances_by_name(instance_name)                          │
│ ❱  86 │   │   return [self._build(instance) for instance in instances]                           │
│    87 │                                                                                          │
│    88 │   def push(self, manifests: List[Path], local: bool = False) -> PushResult:              │
│    89 │   │   return self.connector.push_artifacts(                                              │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │       .0 = <list_iterator object at 0x0000016029107100>                                      │ │
│ │ instance = TrainingCustomJobModel(                                                           │ │
│ │            │   name='wanna-heur-eml',                                                        │ │
│ │            │   project_id='ppt-ctores-adp-ai-f6',                                            │ │
│ │            │   zone='europe-west1-b',                                                        │ │
│ │            │   region='europe-west1',                                                        │ │
│ │            │   labels={                                                                      │ │
│ │            │   │   'wanna_project': 'wanna-heur-eml',                                        │ │
│ │            │   │   'wanna_project_version': '0__0__0',                                       │ │
│ │            │   │   'wanna_project_authors': 'brano-bosansky',                                │ │
│ │            │   │   'author': 'matej-racinsky_at_gendigital-com'                              │ │
│ │            │   },                                                                            │ │
│ │            │   description=None,                                                             │ │
│ │            │                                                                                 │ │
│ │            service_account='sa-wanna-heur-eml@ppt-ctores-adp-ai-f6.iam.gserviceaccount.com', │ │
│ │            │                                                                                 │ │
│ │            network='projects/ppt-ctores-adp-ai-f6/global/networks/europe-west1-gw-network',  │ │
│ │            │   bucket='wanna-heur-eml-test',                                                 │ │
│ │            │   tags=None,                                                                    │ │
│ │            │   metadata=None,                                                                │ │
│ │            │   enable_web_access=True,                                                       │ │
│ │            │                                                                                 │ │
│ │            base_output_directory='gs://wanna-heur-eml-test/wanna-jobs/wanna-heur-eml/output… │ │
│ │            │   tensorboard_ref=None,                                                         │ │
│ │            │   timeout_seconds=86400,                                                        │ │
│ │            │   encryption_spec=None,                                                         │ │
│ │            │   env_vars=None,                                                                │ │
│ │            │   worker=WorkerPoolModel(                                                       │ │
│ │            │   │   python_package=None,                                                      │ │
│ │            │   │   container=ContainerModel(docker_image_ref='data', command=[]),            │ │
│ │            │   │   args=[],                                                                  │ │
│ │            │   │   env=None,                                                                 │ │
│ │            │   │   machine_type='n1-standard-16',                                            │ │
│ │            │   │   gpu=GPU(                                                                  │ │
│ │            │   │   │   count=1,                                                              │ │
│ │            │   │   │   accelerator_type='NVIDIA_TESLA_T4',                                   │ │
│ │            │   │   │   install_gpu_driver=True                                               │ │
│ │            │   │   ),                                                                        │ │
│ │            │   │   boot_disk=None,                                                           │ │
│ │            │   │   replica_count=1                                                           │ │
│ │            │   ),                                                                            │ │
│ │            │   reduction_server=None                                                         │ │
│ │            )                                                                                 │ │
│ │     self = <wanna.core.services.jobs.JobService object at 0x0000016029106F50>                │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Users\E10270\.conda\envs\wanna-heur-eml\lib\site-packages\wanna\core\services\jobs.py:209 in  │
│ _build                                                                                           │
│                                                                                                  │
│   206 │   │   job_paths = JobPaths(self.workdir, instance.bucket or f"gs://{self.config.gcp_pr   │
│   207 │   │   manifest_path = Path(job_paths.get_local_job_wanna_manifest_path(self.version))    │
│   208 │   │   resource: Union[JobResource[CustomJobModel], JobResource[TrainingCustomJobModel]   │
│ ❱ 209 │   │   │   self._create_training_job_resource(instance)                                   │
│   210 │   │   │   if isinstance(instance, TrainingCustomJobModel)                                │
│   211 │   │   │   else self._create_custom_job_resource(instance)                                │
│   212 │   │   )                                                                                  │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │      instance = TrainingCustomJobModel(                                                      │ │
│ │                 │   name='wanna-heur-eml',                                                   │ │
│ │                 │   project_id='ppt-ctores-adp-ai-f6',                                       │ │
│ │                 │   zone='europe-west1-b',                                                   │ │
│ │                 │   region='europe-west1',                                                   │ │
│ │                 │   labels={                                                                 │ │
│ │                 │   │   'wanna_project': 'wanna-heur-eml',                                   │ │
│ │                 │   │   'wanna_project_version': '0__0__0',                                  │ │
│ │                 │   │   'wanna_project_authors': 'brano-bosansky',                           │ │
│ │                 │   │   'author': 'matej-racinsky_at_gendigital-com'                         │ │
│ │                 │   },                                                                       │ │
│ │                 │   description=None,                                                        │ │
│ │                 │                                                                            │ │
│ │                 service_account='sa-wanna-heur-eml@ppt-ctores-adp-ai-f6.iam.gserviceaccount… │ │
│ │                 │                                                                            │ │
│ │                 network='projects/ppt-ctores-adp-ai-f6/global/networks/europe-west1-gw-netw… │ │
│ │                 │   bucket='wanna-heur-eml-test',                                            │ │
│ │                 │   tags=None,                                                               │ │
│ │                 │   metadata=None,                                                           │ │
│ │                 │   enable_web_access=True,                                                  │ │
│ │                 │                                                                            │ │
│ │                 base_output_directory='gs://wanna-heur-eml-test/wanna-jobs/wanna-heur-eml/o… │ │
│ │                 │   tensorboard_ref=None,                                                    │ │
│ │                 │   timeout_seconds=86400,                                                   │ │
│ │                 │   encryption_spec=None,                                                    │ │
│ │                 │   env_vars=None,                                                           │ │
│ │                 │   worker=WorkerPoolModel(                                                  │ │
│ │                 │   │   python_package=None,                                                 │ │
│ │                 │   │   container=ContainerModel(docker_image_ref='data', command=[]),       │ │
│ │                 │   │   args=[],                                                             │ │
│ │                 │   │   env=None,                                                            │ │
│ │                 │   │   machine_type='n1-standard-16',                                       │ │
│ │                 │   │   gpu=GPU(                                                             │ │
│ │                 │   │   │   count=1,                                                         │ │
│ │                 │   │   │   accelerator_type='NVIDIA_TESLA_T4',                              │ │
│ │                 │   │   │   install_gpu_driver=True                                          │ │
│ │                 │   │   ),                                                                   │ │
│ │                 │   │   boot_disk=None,                                                      │ │
│ │                 │   │   replica_count=1                                                      │ │
│ │                 │   ),                                                                       │ │
│ │                 │   reduction_server=None                                                    │ │
│ │                 )                                                                            │ │
│ │     job_paths = <wanna.core.services.path_utils.JobPaths object at 0x0000016029107370>       │ │
│ │ manifest_path = WindowsPath('C:/Projects/others/wanna-heur-eml/build/wanna-jobs/wanna-heur-… │ │
│ │          self = <wanna.core.services.jobs.JobService object at 0x0000016029106F50>           │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Users\E10270\.conda\envs\wanna-heur-eml\lib\site-packages\wanna\core\services\jobs.py:299 in  │
│ _create_training_job_resource                                                                    │
│                                                                                                  │
│   296 │   │   │   }                                                                              │
│   297 │   │   elif job_model.worker.container:                                                   │
│   298 │   │   │   image_ref = job_model.worker.container.docker_image_ref                        │
│ ❱ 299 │   │   │   _, _, tag = self.docker_service.get_image(docker_image_ref=job_model.worker.   │
│   300 │   │   │   job_payload = {                                                                │
│   301 │   │   │   │   "display_name": job_model.name,                                            │
│   302 │   │   │   │   "container_uri": tag,                                                      │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │   image_ref = 'data'                                                                         │ │
│ │   job_model = TrainingCustomJobModel(                                                        │ │
│ │               │   name='wanna-heur-eml',                                                     │ │
│ │               │   project_id='ppt-ctores-adp-ai-f6',                                         │ │
│ │               │   zone='europe-west1-b',                                                     │ │
│ │               │   region='europe-west1',                                                     │ │
│ │               │   labels={                                                                   │ │
│ │               │   │   'wanna_project': 'wanna-heur-eml',                                     │ │
│ │               │   │   'wanna_project_version': '0__0__0',                                    │ │
│ │               │   │   'wanna_project_authors': 'brano-bosansky',                             │ │
│ │               │   │   'author': 'matej-racinsky_at_gendigital-com'                           │ │
│ │               │   },                                                                         │ │
│ │               │   description=None,                                                          │ │
│ │               │                                                                              │ │
│ │               service_account='sa-wanna-heur-eml@ppt-ctores-adp-ai-f6.iam.gserviceaccount.c… │ │
│ │               │                                                                              │ │
│ │               network='projects/ppt-ctores-adp-ai-f6/global/networks/europe-west1-gw-networ… │ │
│ │               │   bucket='wanna-heur-eml-test',                                              │ │
│ │               │   tags=None,                                                                 │ │
│ │               │   metadata=None,                                                             │ │
│ │               │   enable_web_access=True,                                                    │ │
│ │               │                                                                              │ │
│ │               base_output_directory='gs://wanna-heur-eml-test/wanna-jobs/wanna-heur-eml/out… │ │
│ │               │   tensorboard_ref=None,                                                      │ │
│ │               │   timeout_seconds=86400,                                                     │ │
│ │               │   encryption_spec=None,                                                      │ │
│ │               │   env_vars=None,                                                             │ │
│ │               │   worker=WorkerPoolModel(                                                    │ │
│ │               │   │   python_package=None,                                                   │ │
│ │               │   │   container=ContainerModel(docker_image_ref='data', command=[]),         │ │
│ │               │   │   args=[],                                                               │ │
│ │               │   │   env=None,                                                              │ │
│ │               │   │   machine_type='n1-standard-16',                                         │ │
│ │               │   │   gpu=GPU(                                                               │ │
│ │               │   │   │   count=1,                                                           │ │
│ │               │   │   │   accelerator_type='NVIDIA_TESLA_T4',                                │ │
│ │               │   │   │   install_gpu_driver=True                                            │ │
│ │               │   │   ),                                                                     │ │
│ │               │   │   boot_disk=None,                                                        │ │
│ │               │   │   replica_count=1                                                        │ │
│ │               │   ),                                                                         │ │
│ │               │   reduction_server=None                                                      │ │
│ │               )                                                                              │ │
│ │ job_payload = {}                                                                             │ │
│ │      labels = {                                                                              │ │
│ │               │   'wanna_project': 'wanna-heur-eml',                                         │ │
│ │               │   'wanna_project_version': '0__0__0',                                        │ │
│ │               │   'wanna_project_authors': 'brano-bosansky',                                 │ │
│ │               │   'author': 'matej-racinsky_at_gendigital-com',                              │ │
│ │               │   'wanna_name': 'wanna-heur-eml',                                            │ │
│ │               │   'wanna_resource': 'job'                                                    │ │
│ │               }                                                                              │ │
│ │        self = <wanna.core.services.jobs.JobService object at 0x0000016029106F50>             │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Users\E10270\.conda\envs\wanna-heur-eml\lib\site-packages\wanna\core\services\docker.py:192   │
│ in get_image                                                                                     │
│                                                                                                  │
│   189 │   │   │   image = self.image_store.get(docker_image_ref)                                 │
│   190 │   │   │   return image  # type: ignore                                                   │
│   191 │   │   else:                                                                              │
│ ❱ 192 │   │   │   image = self._get_image(                                                       │
│   193 │   │   │   │   docker_image_ref=docker_image_ref,                                         │
│   194 │   │   │   )                                                                              │
│   195 │   │   │   self.image_store.update({docker_image_ref: image})                             │
│                                                                                                  │
│ ╭────────────────────────────────────────── locals ──────────────────────────────────────────╮   │
│ │ docker_image_ref = 'data'                                                                  │   │
│ │             self = <wanna.core.services.docker.DockerService object at 0x00000160291070A0> │   │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────╯   │
│                                                                                                  │
│ C:\Users\E10270\.conda\envs\wanna-heur-eml\lib\site-packages\wanna\core\services\docker.py:238   │
│ in _get_image                                                                                    │
│                                                                                                  │
│   235 │   │   │   )                                                                              │
│   236 │   │   │   file_path = self.work_dir / docker_image_model.dockerfile                      │
│   237 │   │   │   context_dir = self.work_dir / docker_image_model.context_dir                   │
│ ❱ 238 │   │   │   image = self._build_image(                                                     │
│   239 │   │   │   │   context_dir, file_path=file_path, tags=tags, docker_image_ref=docker_ima   │
│   240 │   │   │   )                                                                              │
│   241 │   │   elif isinstance(docker_image_model, ProvidedImageModel):                           │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │         build_args = {                                                                       │ │
│ │                      │   'build_args': {},                                                   │ │
│ │                      │   'add_hosts': {},                                                    │ │
│ │                      │   'labels': {},                                                       │ │
│ │                      │   'network': None,                                                    │ │
│ │                      │   'platforms': None,                                                  │ │
│ │                      │   'secrets': [],                                                      │ │
│ │                      │   'ssh': None,                                                        │ │
│ │                      │   'target': None                                                      │ │
│ │                      }                                                                       │ │
│ │          build_dir = WindowsPath('C:/Projects/others/wanna-heur-eml/build/docker/data')      │ │
│ │        context_dir = WindowsPath('C:/Projects/others/wanna-heur-eml')                        │ │
│ │ docker_image_model = LocalBuildImageModel(                                                   │ │
│ │                      │   name='data',                                                        │ │
│ │                      │   build_type=<ImageBuildType.local_build_image: 'local_build_image'>, │ │
│ │                      │   build_args=None,                                                    │ │
│ │                      │   context_dir=WindowsPath('.'),                                       │ │
│ │                      │   dockerfile=WindowsPath('Dockerfile')                                │ │
│ │                      )                                                                       │ │
│ │   docker_image_ref = 'data'                                                                  │ │
│ │          file_path = WindowsPath('C:/Projects/others/wanna-heur-eml/Dockerfile')             │ │
│ │               self = <wanna.core.services.docker.DockerService object at 0x00000160291070A0> │ │
│ │               tags = [                                                                       │ │
│ │                      │                                                                       │ │
│ │                      'europe-west1-docker.pkg.dev/ppt-ctores-adp-ai-f6/adp-ai-test/wanna-he… │ │
│ │                      │                                                                       │ │
│ │                      'europe-west1-docker.pkg.dev/ppt-ctores-adp-ai-f6/adp-ai-test/wanna-he… │ │
│ │                      ]                                                                       │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Users\E10270\.conda\envs\wanna-heur-eml\lib\site-packages\wanna\core\services\docker.py:127   │
│ in _build_image                                                                                  │
│                                                                                                  │
│   124 │   │   if should_build and not self.quick_mode:                                           │
│   125 │   │   │   if self.cloud_build:                                                           │
│   126 │   │   │   │   logger.user_info(text=f"Building {docker_image_ref} docker image in GCP    │
│ ❱ 127 │   │   │   │   op = self._build_image_on_gcp_cloud_build(                                 │
│   128 │   │   │   │   │   context_dir=context_dir, file_path=file_path, docker_image_ref=docke   │
│   129 │   │   │   │   )                                                                          │
│   130 │   │   │   │   project = convert_project_id_to_project_number(self.project_id)            │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │       build_args = {                                                                         │ │
│ │                    │   'build_args': {},                                                     │ │
│ │                    │   'add_hosts': {},                                                      │ │
│ │                    │   'labels': {},                                                         │ │
│ │                    │   'network': None,                                                      │ │
│ │                    │   'platforms': None,                                                    │ │
│ │                    │   'secrets': [],                                                        │ │
│ │                    │   'ssh': None,                                                          │ │
│ │                    │   'target': None                                                        │ │
│ │                    }                                                                         │ │
│ │      context_dir = WindowsPath('C:/Projects/others/wanna-heur-eml')                          │ │
│ │ docker_image_ref = 'data'                                                                    │ │
│ │        file_path = WindowsPath('C:/Projects/others/wanna-heur-eml/Dockerfile')               │ │
│ │             self = <wanna.core.services.docker.DockerService object at 0x00000160291070A0>   │ │
│ │     should_build = True                                                                      │ │
│ │             tags = [                                                                         │ │
│ │                    │                                                                         │ │
│ │                    'europe-west1-docker.pkg.dev/ppt-ctores-adp-ai-f6/adp-ai-test/wanna-heur… │ │
│ │                    │                                                                         │ │
│ │                    'europe-west1-docker.pkg.dev/ppt-ctores-adp-ai-f6/adp-ai-test/wanna-heur… │ │
│ │                    ]                                                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Users\E10270\.conda\envs\wanna-heur-eml\lib\site-packages\wanna\core\services\docker.py:302   │
│ in _build_image_on_gcp_cloud_build                                                               │
│                                                                                                  │
│   299 │   │                                                                                      │
│   300 │   │   dockerfile = os.path.relpath(file_path, context_dir)                               │
│   301 │   │   tar_filename = self.work_dir / "build" / "docker" / f"{docker_image_ref}.tar.gz"   │
│ ❱ 302 │   │   make_tarfile(context_dir, tar_filename)                                            │
│   303 │   │   blob_name = os.path.relpath(tar_filename, self.work_dir).replace("\\", "/")        │
│   304 │   │   blob = upload_file_to_gcs(filename=tar_filename, bucket_name=self.bucket, blob_n   │
│   305 │   │   tags_args = " ".join([f"--destination={t}" for t in tags]).split()                 │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │      context_dir = WindowsPath('C:/Projects/others/wanna-heur-eml')                          │ │
│ │ docker_image_ref = 'data'                                                                    │ │
│ │       dockerfile = 'Dockerfile'                                                              │ │
│ │        file_path = WindowsPath('C:/Projects/others/wanna-heur-eml/Dockerfile')               │ │
│ │             self = <wanna.core.services.docker.DockerService object at 0x00000160291070A0>   │ │
│ │             tags = [                                                                         │ │
│ │                    │                                                                         │ │
│ │                    'europe-west1-docker.pkg.dev/ppt-ctores-adp-ai-f6/adp-ai-test/wanna-heur… │ │
│ │                    │                                                                         │ │
│ │                    'europe-west1-docker.pkg.dev/ppt-ctores-adp-ai-f6/adp-ai-test/wanna-heur… │ │
│ │                    ]                                                                         │ │
│ │     tar_filename = WindowsPath('C:/Projects/others/wanna-heur-eml/build/docker/data.tar.gz') │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Users\E10270\.conda\envs\wanna-heur-eml\lib\site-packages\wanna\core\utils\gcp.py:349 in      │
│ make_tarfile                                                                                     │
│                                                                                                  │
│   346 │   """                                                                                    │
│   347 │   os.makedirs(output_filename.parent.absolute(), exist_ok=True)                          │
│   348 │   with tarfile.open(output_filename, "w:gz") as tar:                                     │
│ ❱ 349 │   │   tar.add(source_dir, arcname=".")                                                   │
│   350                                                                                            │
│   351                                                                                            │
│   352 def upload_file_to_gcs(filename: Path, bucket_name: str, blob_name: str) -> storage.blob   │
│                                                                                                  │
│ ╭────────────────────────────────────────── locals ───────────────────────────────────────────╮  │
│ │ output_filename = WindowsPath('C:/Projects/others/wanna-heur-eml/build/docker/data.tar.gz') │  │
│ │      source_dir = WindowsPath('C:/Projects/others/wanna-heur-eml')                          │  │
│ │             tar = <tarfile.TarFile object at 0x0000016029106320>                            │  │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯  │
│                                                                                                  │
│ C:\Users\E10270\.conda\envs\wanna-heur-eml\lib\tarfile.py:2186 in add                            │
│                                                                                                  │
│   2183 │   │   │   self.addfile(tarinfo)                                                         │
│   2184 │   │   │   if recursive:                                                                 │
│   2185 │   │   │   │   for f in sorted(os.listdir(name)):                                        │
│ ❱ 2186 │   │   │   │   │   self.add(os.path.join(name, f), os.path.join(arcname, f),             │
│   2187 │   │   │   │   │   │   │   recursive, filter=filter)                                     │
│   2188 │   │                                                                                     │
│   2189 │   │   else:                                                                             │
│                                                                                                  │
│ ╭─────────────────────────── locals ───────────────────────────╮                                 │
│ │   arcname = '.'                                              │                                 │
│ │         f = '.idea'                                          │                                 │
│ │    filter = None                                             │                                 │
│ │      name = WindowsPath('C:/Projects/others/wanna-heur-eml') │                                 │
│ │ recursive = True                                             │                                 │
│ │      self = <tarfile.TarFile object at 0x0000016029106320>   │                                 │
│ │   tarinfo = <TarInfo '.' at 0x160290c4340>                   │                                 │
│ ╰──────────────────────────────────────────────────────────────╯                                 │
│                                                                                                  │
│ C:\Users\E10270\.conda\envs\wanna-heur-eml\lib\tarfile.py:2186 in add                            │
│                                                                                                  │
│   2183 │   │   │   self.addfile(tarinfo)                                                         │
│   2184 │   │   │   if recursive:                                                                 │
│   2185 │   │   │   │   for f in sorted(os.listdir(name)):                                        │
│ ❱ 2186 │   │   │   │   │   self.add(os.path.join(name, f), os.path.join(arcname, f),             │
│   2187 │   │   │   │   │   │   │   recursive, filter=filter)                                     │
│   2188 │   │                                                                                     │
│   2189 │   │   else:                                                                             │
│                                                                                                  │
│ ╭────────────────────────── locals ──────────────────────────╮                                   │
│ │   arcname = '.\\.idea'                                     │                                   │
│ │         f = 'copilot'                                      │                                   │
│ │    filter = None                                           │                                   │
│ │      name = 'C:\\Projects\\others\\wanna-heur-eml\\.idea'  │                                   │
│ │ recursive = True                                           │                                   │
│ │      self = <tarfile.TarFile object at 0x0000016029106320> │                                   │
│ │   tarinfo = <TarInfo './.idea' at 0x160290c4700>           │                                   │
│ ╰────────────────────────────────────────────────────────────╯                                   │
│                                                                                                  │
│ C:\Users\E10270\.conda\envs\wanna-heur-eml\lib\tarfile.py:2186 in add                            │
│                                                                                                  │
│   2183 │   │   │   self.addfile(tarinfo)                                                         │
│   2184 │   │   │   if recursive:                                                                 │
│   2185 │   │   │   │   for f in sorted(os.listdir(name)):                                        │
│ ❱ 2186 │   │   │   │   │   self.add(os.path.join(name, f), os.path.join(arcname, f),             │
│   2187 │   │   │   │   │   │   │   recursive, filter=filter)                                     │
│   2188 │   │                                                                                     │
│   2189 │   │   else:                                                                             │
│                                                                                                  │
│ ╭────────────────────────────── locals ──────────────────────────────╮                           │
│ │   arcname = '.\\.idea\\copilot'                                    │                           │
│ │         f = 'chatSessions'                                         │                           │
│ │    filter = None                                                   │                           │
│ │      name = 'C:\\Projects\\others\\wanna-heur-eml\\.idea\\copilot' │                           │
│ │ recursive = True                                                   │                           │
│ │      self = <tarfile.TarFile object at 0x0000016029106320>         │                           │
│ │   tarinfo = <TarInfo './.idea/copilot' at 0x160290c6c80>           │                           │
│ ╰────────────────────────────────────────────────────────────────────╯                           │
│                                                                                                  │
│ C:\Users\E10270\.conda\envs\wanna-heur-eml\lib\tarfile.py:2186 in add                            │
│                                                                                                  │
│   2183 │   │   │   self.addfile(tarinfo)                                                         │
│   2184 │   │   │   if recursive:                                                                 │
│   2185 │   │   │   │   for f in sorted(os.listdir(name)):                                        │
│ ❱ 2186 │   │   │   │   │   self.add(os.path.join(name, f), os.path.join(arcname, f),             │
│   2187 │   │   │   │   │   │   │   recursive, filter=filter)                                     │
│   2188 │   │                                                                                     │
│   2189 │   │   else:                                                                             │
│                                                                                                  │
│ ╭───────────────────────────────────── locals ─────────────────────────────────────╮             │
│ │   arcname = '.\\.idea\\copilot\\chatSessions'                                    │             │
│ │         f = 'xd.lck'                                                             │             │
│ │    filter = None                                                                 │             │
│ │      name = 'C:\\Projects\\others\\wanna-heur-eml\\.idea\\copilot\\chatSessions' │             │
│ │ recursive = True                                                                 │             │
│ │      self = <tarfile.TarFile object at 0x0000016029106320>                       │             │
│ │   tarinfo = <TarInfo './.idea/copilot/chatSessions' at 0x160290c6ec0>            │             │
│ ╰──────────────────────────────────────────────────────────────────────────────────╯             │
│                                                                                                  │
│ C:\Users\E10270\.conda\envs\wanna-heur-eml\lib\tarfile.py:2180 in add                            │
│                                                                                                  │
│   2177 │   │   # Append the tar header and data to the archive.                                  │
│   2178 │   │   if tarinfo.isreg():                                                               │
│   2179 │   │   │   with bltn_open(name, "rb") as f:                                              │
│ ❱ 2180 │   │   │   │   self.addfile(tarinfo, f)                                                  │
│   2181 │   │                                                                                     │
│   2182 │   │   elif tarinfo.isdir():                                                             │
│   2183 │   │   │   self.addfile(tarinfo)                                                         │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │   arcname = '.\\.idea\\copilot\\chatSessions\\xd.lck'                                        │ │
│ │         f = <_io.BufferedReader                                                              │ │
│ │             name='C:\\Projects\\others\\wanna-heur-eml\\.idea\\copilot\\chatSessions\\xd.lc… │ │
│ │    filter = None                                                                             │ │
│ │      name = 'C:\\Projects\\others\\wanna-heur-eml\\.idea\\copilot\\chatSessions\\xd.lck'     │ │
│ │ recursive = True                                                                             │ │
│ │      self = <tarfile.TarFile object at 0x0000016029106320>                                   │ │
│ │   tarinfo = <TarInfo './.idea/copilot/chatSessions/xd.lck' at 0x160290c7040>                 │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Users\E10270\.conda\envs\wanna-heur-eml\lib\tarfile.py:2208 in addfile                        │
│                                                                                                  │
│   2205 │   │   bufsize=self.copybufsize                                                          │
│   2206 │   │   # If there's data to follow, append it.                                           │
│   2207 │   │   if fileobj is not None:                                                           │
│ ❱ 2208 │   │   │   copyfileobj(fileobj, self.fileobj, tarinfo.size, bufsize=bufsize)             │
│   2209 │   │   │   blocks, remainder = divmod(tarinfo.size, BLOCKSIZE)                           │
│   2210 │   │   │   if remainder > 0:                                                             │
│   2211 │   │   │   │   self.fileobj.write(NUL * (BLOCKSIZE - remainder))                         │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │     buf = b'././@PaxHeader\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ bufsize = None                                                                               │ │
│ │ fileobj = <_io.BufferedReader                                                                │ │
│ │           name='C:\\Projects\\others\\wanna-heur-eml\\.idea\\copilot\\chatSessions\\xd.lck'> │ │
│ │    self = <tarfile.TarFile object at 0x0000016029106320>                                     │ │
│ │ tarinfo = <TarInfo './.idea/copilot/chatSessions/xd.lck' at 0x160290c7280>                   │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Users\E10270\.conda\envs\wanna-heur-eml\lib\tarfile.py:258 in copyfileobj                     │
│                                                                                                  │
│    255 │   │   dst.write(buf)                                                                    │
│    256 │                                                                                         │
│    257 │   if remainder != 0:                                                                    │
│ ❱  258 │   │   buf = src.read(remainder)                                                         │
│    259 │   │   if len(buf) < remainder:                                                          │
│    260 │   │   │   raise exception("unexpected end of data")                                     │
│    261 │   │   dst.write(buf)                                                                    │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │    blocks = 0                                                                                │ │
│ │   bufsize = 16384                                                                            │ │
│ │       dst = <gzip on 0x16029106260>                                                          │ │
│ │ exception = <class 'OSError'>                                                                │ │
│ │    length = 7572                                                                             │ │
│ │ remainder = 7572                                                                             │ │
│ │       src = <_io.BufferedReader                                                              │ │
│ │             name='C:\\Projects\\others\\wanna-heur-eml\\.idea\\copilot\\chatSessions\\xd.lc… │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
PermissionError: [Errno 13] Permission denied

My `.dockerignore` file

docker-py tars the whole build directory and sends it to the docker-machine

excluding large folders and files unrelated to docker build can save a lot of time on each build

wanna project

local params README.md src/wanna_heur_eml/pipeline.py wanna.yaml build

Dev & Python folders

.dockerignore .git .gitignore .idea .vscode venv pycache .pyc .pyo .pyd .Python env pip-log.txt pip-delete-this-directory.txt .tox .coverage .coverage. .cache nosetests.xml coverage.xml .cover .log .git .mypy_cache .pytest_cache .hypothesis .ruff_cache htmlcov

jsilva commented 3 months ago

Is not docker-py that does the tar, but just simple python ziip/tar code that uploads the required cloud build docker context dir for cloud bukld

I will look into using .dockerignore file and skip any entries from the docker context zip.

jsilva commented 3 months ago

fixed in https://github.com/avast/wanna-ml/pull/119 and released in 0.3.3