Import External Libraries (Glue) Without Internet

0

Hi All,

We have a client requirement where we are running our process in glue using python shell. Since they are using VPN, we do not have internet connectivity and want some of the pypi packages to be imported in our glue job for further processing.

How do we import all those packages without internet and also include their dependencies.

Please recommend the best possible solution which can help to import all the libraries without internet connectivity.

We tried creating wheel package for each library and hosting it in S3. But it didn't work either.

已提問 6 個月前檢視次數 244 次
1 個回答
0

Glue shell (unlike Glue ETL) doesn't allow installing packages from s3 directly, but what you can do is create a Pypi repo in s3 with the things you need and ask the shell to use it instead of the internet one.
To do that you need:

  • Create a repo on s3 with your dependencies, for instance using https://github.com/wolever/pip2pi
  • In the --additional-python-modules parameter you can specify pip flags, so you can use -i to point to the repository index on s3
profile pictureAWS
專家
已回答 6 個月前
  • Hi Gonzalo, Thanks for your revert. Could you add more details on the step, I tried --additional-python-modules where I have passed pypi libraries like keras==2.15.0 etc and also used --python-modules-installer-option" : "--no-index --find-links=" but this didn't work either. I had all my wheel files present inside S3 in a package folder.

  • I think that --python-modules-installer-option is for Glue ETL, try adding the flags directly inside the --additional-python-modules . Check the logs to see if it picks it up

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南