tom_saunders
05/11/2022, 11:32 AMmeltano add --custom extractor tap-oracle
in terms of the pip install argument, not sure what to go for when prompted with
`Specify the plugin's pip install
argument, for example:`
- PyPI package name:
tap-oracle
- Git repository URL:
git+https://<PLUGIN REPO URL>.git
- local directory, in editable/development mode:
-e extract/tap-oracle
- 'n' if using a local executable (nothing to install)
Default: plugin name as PyPI package name
Is it possible to do this? To install the oracle-tap on a machine with no internet access or access to a proxy etc.
Any help much appreciated - Thanks!pat_nadolny
05/11/2022, 12:16 PM--custom
command, we're working on some features that will make this waay easier but for now this should work:
meltano add --custom extractor tap-oracle
(namespace) [tap_oracle]: <hit enter - accept default>
(pip_url) [tap-oracle]: pipelinewise-tap-oracle
(executable) [pipelinewise-tap-oracle]: tap-oracle
(capabilities) [[]]: catalog,discover,state
(settings) [[]]: <hit enter - accept default>
visch
05/11/2022, 12:30 PMtom_saunders
05/11/2022, 12:31 PMvisch
05/11/2022, 12:34 PMpip_url: -e extract/tap-oracle
Everything else the same
``````pat_nadolny
05/11/2022, 12:50 PMmeltano install
will get your .meltano directory updated, then you can zip it. One thing to note is that you will need to update your meltano.yml in the private instance also so meltano knows how to find tap-oracle and call it properly. To avoid any inconsistencies it might be better to zip your entire directory and do a full replace instead of moving a single directory from .meltano, or build a docker image.tom_saunders
05/11/2022, 1:01 PMextractors:
- name: tap-oracle
namespace: tap_oracle
pip_url: tap-oracle
executable: tap-oracle
capabilities:
- catalog
- discover
And that seems to have installed correctly as I can run meltano invoke tap-oracle --help
I have zipped up the full meltano project now and moved over to the private instance. Do I need to change the meltano .yml before running meltano install
? If I've understood correclty I should change the pip_url to pip_url: -e extract/tap-oracle
, however there is no tap-oracle in my local extract directory.
I do realise I might be better served using a container-based approach, and I will explore that, I was just trying to get started quickly and have failed miserably so far 😂pat_nadolny
05/11/2022, 1:39 PMchristoph
05/12/2022, 12:20 AMI do realise I might be better served using a container-based approachI don't think that's necessary and the infrastructure and know-how required for that will involve time and cost. All you need to do is to copy the contents of the pip cache from a box where you ran the install over into your network enclave / air-gapped host. And then just configure your
pip
configuration to look for wheels in that copied location (via find-links
option)
Works like charm. Should take 5 minutes to configure.tom_saunders
05/12/2022, 12:37 PMvisch
05/12/2022, 1:16 PMtom_saunders
05/12/2022, 1:31 PMvisch
05/12/2022, 1:32 PMpat_nadolny
05/12/2022, 1:34 PMmeltano run/invoke/elt
command. I think 🤔visch
05/12/2022, 1:50 PMvisch@visch-ubuntu:~/git/tap-clickup/.meltano/extractors/tap-clickup/venv/bin$ cat activate
# This file must be used with "source bin/activate" *from bash*
# you cannot run it directly
deactivate () {
# reset old environment variables
if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
PATH="${_OLD_VIRTUAL_PATH:-}"
export PATH
unset _OLD_VIRTUAL_PATH
fi
if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
export PYTHONHOME
unset _OLD_VIRTUAL_PYTHONHOME
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r
fi
if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
PS1="${_OLD_VIRTUAL_PS1:-}"
export PS1
unset _OLD_VIRTUAL_PS1
fi
unset VIRTUAL_ENV
if [ ! "${1:-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
fi
}
# unset irrelevant variables
deactivate nondestructive
VIRTUAL_ENV="/home/visch/git/tap-clickup/.meltano/extractors/tap-clickup/venv"
Note VIRTUAL_ENV="/home/visch/git/tap-clickup/.meltano/extractors/tap-clickup/venv"
visch
05/12/2022, 1:51 PMvisch
05/12/2022, 1:51 PMtom_saunders
05/12/2022, 1:52 PMvisch
05/12/2022, 1:53 PMvisch
05/12/2022, 1:53 PMvisch
05/12/2022, 1:55 PMtom_saunders
05/12/2022, 2:54 PMtom_saunders
05/12/2022, 4:18 PMchristoph
05/13/2022, 3:35 AMI have attempted the pip cache thing but am getting no luck, I am
getting dependency issues for packages that are not in my pip cache 🙃@tom_saunders It's really pretty simple. I think me calling it 'pip cache' was a bit misleading. Here are the steps in order: 1. On a machine that matches your air-gapped target (i.e. same OS version and same Python version and same CPU architecture), download everything that is needed from PyPi into a directory. To do so run
pip download -d /tmp/tap-oracle-wheels tap-oracle
2. Zip up the contents of that directory: tar czf /tmp/tap-oracle-wheels.tgz /tmp/tap-oracle-wheels
3. Copy /tmp/tap-oracle-wheels.tgz
to your air-gapped machine and extract it (tar -C /tmp -xzf /tmp/tap-oracle-wheels.tgz
)
4. On your airgapped machine (where you presumably already have you meltano.yml and related project files) add this to your pip configuration either via config files or via env variables in order to tell pip to look in /tmp/tap-oracle-wheels
folder for wheels and sources:
a. --find-links /tmp/tap-oracle-wheels
b. e.g when using pip.conf
(either global /etc/pip.conf
or per-user ~/.config/pip/pip.conf
), it would look like
[global]
find-links =
/tmp/tap-oracle-wheels
christoph
05/13/2022, 3:38 AMbut some kind of application bundle would probably work (pyinstaller maybe?)@visch I think plain
pip
capabilities should suffice. See my detailed instructions above.tom_saunders
05/13/2022, 6:25 AMchristoph
05/13/2022, 6:53 AMpip
is quite a flexible tool. There is more detailed information available on the official documentaion site. https://pip.pypa.io/en/stable/topics/configuration
Replacing pip
with docker or k8s is a bit like calling in an airstrike when a precisely placed artillery strike is all that's needed. 😉visch
05/13/2022, 1:10 PMmeltano lock --local
? @edgar_ramirez_mondragonchristoph
05/14/2022, 12:05 AMpip download
to manage a very simple local pip index http server's content directory ... in case you need to scale my above described method to a few more computers. 😉