Issue in creating a layer for AWS lambda for psycopg2 - python

I am trying to create a layer for aws lambda for psycopg. I am following the answer to the question - psycopg2 folder zipped into python venv lambda function
Screenshot of the process from above link
However I am getting the below error while executing the docker step.
$ docker run "lambci/lambda:build-python3.8" /bin/sh -c "pip install -r requirements.txt -t /python/lib/python3.8/site-packages/; exit"
**docker: Error response from daemon: failed to create shim task: OCI
runtime create failed: runc create failed: unable to start container
process: exec: "C:/Users/aameen/AppData/Local/Programs/Git/usr/bin/sh":
stat C:/Users/aameen/AppData/Local/Programs/Git/usr/bin/sh: no such file
or directory: unknown.**
I am executing this on the git bash on windows. May be the problem lies there.

Related

docker: Error response from daemon: create ${PWD}: "${PWD}" includes invalid characters for a local volume name,

I am getting the full error
docker: Error response from daemon: create ${PWD}: "${PWD}" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path.
When I try running the command
docker run --gpus all --rm -it -v ${PWD}:/home/EEGNet --name EEGNet_inner_speech eegnet_env:latest python experiment.py
I am on Windows 10, 21H2, -19044.1706, though it might have to do with the Intel(R) Core(TM) i5-6300U CPU #2.40GHz.
This question was previously asked here however if I switch my file path for the ${PWD} such as
docker run --gpus all --rm -it -v C:\Users\wesie\EEGNet_inner_speech --name EEGNet_inner_speech eegnet_env:latest python experiment.py
docker run --gpus all --rm -it -v C:\Users\wesie\EEGNet_inner_speech eegnet_env:latest python experiment.py
or switch ${PWD} to %cd% as the previous question suggested I get the error
docker: Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: Running hook #0:: error running hook: signal: segmentation fault, stdout: , stderr:: unknown.
Second error asked here previously in stack overflow. and here in Docker's Community
Any idea on how to fix these? Full directions:
Run git clone https://github.com/naomike/EEGNet_inner_speech.git
Place dataset under dataset directory Build a docker container by
running docker image build -t eegnet_env:latest .
Run docker run --gpus all --rm -it -v ${PWD}:/home/EEGNet --name EEGNet_inner_speech eegnet_env:latest python experiment.py, and you
see resulting files created in the directory.

MLFlow projects; bash: python: command not found

I'm running MLflow Project for a model using following command from my ubuntu 20.04 terminal
mlflow run . --no-conda -P alpha=0.5
My system doesn't have conda or python (It does however have python3). So, I added alias for python using terminal
alias python='python3'
After which I could open python in terminal using python. However, I still got the same error
2021/11/21 08:07:34 INFO mlflow.projects.utils: === Created directory /tmp/tmpp4h595ql for downloading remote URIs passed to arguments of type 'path' ===
2021/11/21 08:07:34 INFO mlflow.projects.backend.local: === Running command 'python tracking.py 0.5 0.1' in run with ID 'e50ca47b3f8848a083906be6220c26fc' ===
bash: python: command not found
2021/11/21 08:07:34 ERROR mlflow.cli: === Run (ID 'e50ca47b3f8848a083906be6220c26fc') failed ===
How to get rid of this error?
Change python to python3 in the MLproject file to the resolve error.
command: "python3 tracking.py {alpha} {l1_ratio}"
Running the command below in the terminal helped me:
$ sudo apt install python-is-python3
After installation, run the ML project and it should work.

docker-compose error: "no such file or directory" on Windows

I am following along with this tutorial for running a Flask server using Docker. I am working on a Windows machine so I am using Docker Toolbox.
Once I enter the command to create the database table:
docker-compose run web /usr/local/bin/python create_db.py
I get the following error:
Error response from daemon: OCI runtime create failed:
container_linux.go:346: starting container process caused "exec:
\"C:/Program Files/Git/usr/local/bin/python\": stat C:/Program
Files/Git/usr/local/bin/python: no such file or directory": unknown
I am not sure why I am getting this error, any suggestions on how to fix this error would be greatly appreciated. Thank you.
The command fails because windows tries to parse the path, this can be circumvented by quoting the path:
docker-compose run web python create_db.py
If the above fails a double dash can be used:
docker-compose run web -- "/usr/local/bin/python create_db.py"
I had to change the current directory, and then to execute the script :
docker-compose run web bash -c "cd /usr/local/bin/; python create_db.py"

error when build the jar in mongo-hadoop using $ ./gradlew jar command

I have cloned the mongo-hadoop connector git repository using the below reference,
http://docs.mongodb.org/ecosystem/tutorial/getting-started-with-hadoop/
After successful cloning while i am trying to build jar using $ ./gradlew jar its showing following exception,
hduser#mypc:/mongo-hadoop$ ./gradlew jar
:compileJava
FAILURE: Build failed with an exception.
* What went wrong:
Could not create service of type TaskArtifactStateCacheAccess using TaskExecutionServices.createCacheAccess().
> Failed to create parent directory '/mongo-hadoop/.gradle' when creating directory '/mongo-hadoop/.gradle/2.2.1/taskArtifacts'
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
What will be the reason for this could any one help me to sort out this issue.

Starting qsub in parent folder with Python fails

I'm creating a Python script to setup a series of calculations on a remote calculation cluster. However I have run into a problem.
The calculation on the remote server is started with the command:
qsub Run.sh
Run.sh is located in the folder ./sol/
If I enter ./sol/ and run:
python25 -c "import os;os.system(\"qsub Run.sh\")"
Every thing works like it should.
However, If I am located in ./ and run this command:
python25 -c "import os;os.chdir(\"sol\");os.system(\"qsub Run.sh\")"
qsub failes with this error message:
*** error from copy
Host key verification failed.
lost connection
*** end error output
Does anyone know why this is? I use python version 2.5.1 and unix 2.6.18

Categories