How to install Oracle driver on Apache Superset (without internet access) - oracle

I opened this question as a large number of people fail to install Oracle driver on Apache Superset with or without internet access.

To install Oracle driver on Apache Superset (without internet access) you will need to :
Install cx_Oracle python package on docker container
Install Oracle Client libraries on docker container
1. How to install cx_Oracle python package on docker container (without internet access)
Download cx_Oracle python package (WHL) for docker container python version and architecture (cx_Oracle-8.2.1-cp37-cp37m-manylinux1_x86_64.whl) and move your file on /superser/docker/ folder.
Create a requirements-local.txt on /superset/docker/ folder and add /app/docker/cx_Oracle-8.2.1-cp37-cp37m-manylinux1_x86_64.whl in it.
That's all. When you will use docker-compose up command, the package will be installed on docker container.
2. How to install Oracle Client libraries on docker container (without internet access)
Use docker-compose down command.
Download libaio1_0.3.112-3_amd64.deb package from Debian website.
Download Oracle Client libraries rpm package from Oracle website (oracle-instantclient-basic-21.1.0.0.0-1.x86_64.rpm).
Install alien on a linux computer (sudo apt-get install alien).
Use alien to transform your rpm package on a deb one with alien --to-deb oracle-instantclient-basic-21.1.0.0.0-1.x86_64.rpm command.
Start Apache Superset with docker-compose up command.
Identify the id of your Apache Superset docker container with docker container ls command.
Move your libaio1_0.3.112-3_amd64.deb package to your container with docker cp libaio1_0.3.112-3_amd64.deb [CONTAINER_ID]:/app/ command.
Move your Oracle Client libraries package to your container with docker cp oracle-instantclient-basic-21.1.0.0.0-2_amd64.deb [CONTAINER_ID]:/app/ command.
Install package on docker container with docker exec [CONTAINER_ID] dpkg -i /app/libaio1_0.3.112-3_amd64.deb command.
Install package on docker container with docker exec [CONTAINER_ID] dpkg -i /app/oracle-instantclient-basic-21.1.0.0.0-2_amd64.deb command.
That's all. You can now connect Apache Superset to your Oracle database.

Related

issue while installing docker for Mac using command line?

I want to install docker using command line not using docker for mac. I have downloaded the individual binary for Mac from this link.
docker ce binaries
I am able to run docker command but if I run docker ps then it shows
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
I tried another way to downloading docker using brew as below
brew cask install docker
But using brew it only download the desktop setup of docker and I have to start it manually.
So I am looking for a solution in which I can install and run docker through command without involving any UI.
Thanks
The error above means that the docker service is not running so you have to run it first. Then enable it to start on boot - to avoid the need to start it each time you login to your macOS - at the end you should be able to use docker cli without issues

How to download Docker CLI only for Windows 7

I'm using Windows 7 Pro and have existing shared Docker engine running on a Linux. I would like to use my workstation (with development environment) to access shared Docker engine.
Does someone know how to retrieve Docker client only for Windows 7 ? I have no admin privilege, so I can't install Docker Toolbox.
Older Clients can be found here https://download.docker.com/win/static/stable/x86_64/
And here a some newer Builds by Stefan Scherer (Docker employee) https://github.com/StefanScherer/docker-cli-builder.
Just download docker.exe and add it to your windows path variable.
Then set your DOCKER_HOST variable to define against which Docker daemon you want to speak.
The official Downloads have finally been published:
Mac CLI binaries are available at
https://download.docker.com/mac/static/stable/
Windows CLI (and daemon) binaries at https://download.docker.com/win/
Linux CLI packages are available for each distro as docker-cli (deb and rpm) packages: https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/
From: https://github.com/docker/cli/issues/2281#issuecomment-947699400
Although docker provides a REST-like API, there aren't many clients for it. A quick google turned up one on github, but ymmv. Even if you did find one, you're likely to run into the same problems involved in running docker-ce locally anyway.
There are a handful of gui clients that you could run on that engine and access with a browser, but if you are specifically after a cli you're SOL with this.
If you have an ssh client (git bash, or putty, or something), and you can arrange to run a bastion container on the engine, then you could run a container to ssh into and use that as if it's your local machine. You'd still have to scp resources onto it, but you'll eventually have to solve that problem anyway. Something like:
sudo docker container run --interactive --tty -v /var/run/docker.sock:/var/run/docker.sock image
Where 'image' is a linux image with an ssh server and appropriate keys, git, and docker installed. You could mount a local volume for persistence, or you could just keep everything in git.

Is it possible to install CNTK on a macbook?

It is possible to install Microsoft CNTK on a macbook? I have OS X El Capitan. The official Microsoft documentation at https://github.com/Microsoft/CNTK/wiki/Setup-CNTK-on-your-machine doesn't provide any information for mac users.
Thank you
As of June 2017, you can only run CNTK on OSX using Docker (which will run a Linux container)
Documentation from Microsoft is available here: https://learn.microsoft.com/en-us/cognitive-toolkit/CNTK-Docker-Containers
If you want to run the CPU version of CNTK (as opposed to a GPU enabled) you'll need to pull a particular version of the docker container. See: https://hub.docker.com/r/microsoft/cntk/
I recommend using the following for CPU CNTK:
docker pull microsoft/cntk:2.0-cpu-python3.5
Once you've pulled the container above, you can use Jupyter Notebooks to look at tutorials etc:
First, run the container:
docker run -d -p 8888:8888 --name cntk-jupyter-notebooks -t microsoft/cntk:2.0-cpu-python3.5
Then run this command:
docker exec -it cntk-jupyter-notebooks bash -c "source /cntk/activate-cntk && jupyter-notebook --no-browser --port=8888 --ip=0.0.0.0 --notebook-dir=/cntk/Tutorials --allow-root"
You'll want to access the shell to run CNTK commands. You can attach a bash shell using docker.
Get your container id
docker ps
Then attach a shell
docker exec -it <container_id> bash
While it might not be supported on Mac directly, you can always use a virtual machine to get around.
You can setup docker in your local environment.
https://docs.docker.com/docker-for-mac/
Follow its documentations on how to install on Docker
https://github.com/Microsoft/CNTK/wiki/CNTK-Docker-Containers
We currently support both Linux and Windows. Mac support is on our ToDo or would be interested in community contribution.
I'm currently building CNTK on a linux machine without root access, installing every dependency with linuxbrew (a fork of homebrew). So I think is possible to build on MacOS natively. You can try building it from source with CNTK linux manual to build from source. Let me know if you have any issue.

Build or Install pg_loader on Windows

I am running PostgreSQL 9.6 on a Windows 7 laptop that is tightly managed by corporate IT. I do not have admin privileges on this laptop, but can do "many" things, including software installation, through elevated rights granted through BeyondTrust.
I use this database to import a number of medium-sized datasets from various sources and perform some in-depth analysis and reporting. These datasets have a crazy variation of encoding and formatting which creates challenges while importing them. For one dataset, I first import it into MySQL, strip offending characters from the data, export it back out to CSV, and finally import this cleaned-up data into PostgreSQL.
As an experiment, I installed PostgreSQL 9.6 and pg_loader on my home iMac running macOS 10.12, and it is able to import all of the datasets with no problem.
Given all this as a backdrop, I have a need to use pg_loader to import various datasets. However, the website does not offer either a Windows installer or instructions for compiling it on Windows.
Can anyone point me in the direction of one of the following, with the list going from most desirable to least desirable?
Windows installer of pg_loader
Windows installer of a comparable alternative to pg_loader
Detailed instructions for compiling pg_loader on Windows
Suggestions for using Python to clean up the data prior to import (caveat: I have very little experience with Python)
You can install the Windows Subsystem for Linux, install a Linux distro, then install pgloader with apt or other package manager -
$ sudo apt install pgloader
$ pgloader --version
pgloader version "3.4.1"
compiled with SBCL 1.3.3.debian
$ cd /mnt/c/Users/bburns/Desktop
$ pgloader ....
This solution may come a little late to the original asker, but for those still searching for a windows solution. I can confirm that I was able to get pgloader working using Docker for Windows.
My environment is a local MySQL install on a Windows 10 PC. I installed Docker for Windows. I then installed PostgreSQL via docker:
docker run --name some-postgres -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword -d postgres
Finally, I ran pgloader via docker to pull the schema & data from mysql to postgres using the following:
docker run --rm --name pgloader dimitri/pgloader:latest pgloader
mysql://root:root#host.docker.internal/my_db_name
pgsql://postgres:mysecretpassword#host.docker.internal/postgres
This created a schema called "my_db_name" on my postgres instance. The "root:root" and "postgres:mysecretpassword" are my username:password details. This is obviously a production ready environment! The other useful bit "host.docker.internal" is docker's reference to the parent host environment. Also, I ignored the SBCL warning.
I'm still processing the results. Most everything looks like it migrated successfully. I'm missing triggers (unsupported) and some foreign keys (bug?). Anyways, I hope this might be helpful to others.

rc-update command can not be found in docker gentoo image

My docker image is tianon/gentoo-stage3:latest
And my host system is centos7 and my docker version is Docker version 1.6.0, build 4749651
When I run this image , I found I can not use rc-update command. ls -l /sbin/rc* show empty result.
I have no idea what package I need to install.
rc-update is provided by the sys-apps/openrc package. Why you don't have it is a mystery without knowing more about the image / setup. The image may be using systemd, but that doesn't necessarily rule out the openrc package being installed.
You should run: ps -p 1 -o command. That will give you an indication of your init system. If it says systemd, whatever you are trying to do with rc-update should probably be done with the systemctl command instead.
If you are indeed using sysvinit / openrc, I suggest you update your openrc package by emerge -a openrc That will restore the rc-update command.

Resources