Python Fabric error when executing git archive command - python

I'm running Fabric on a windows 7 machine, when I type:
fab production setup
I get the following error:
[localhost] run: git archive --format=tar master > 20110221142115.tar
Warning: local() encountered an error (return code 1) while executing 'git archi
ve --format=tar master > 20110221142115.tar'
the fabric file works fine on my Windows XP machine, but I can't seem to get past this error. I also tried running the "git archive" command from the prompt, it works fine no issues. Any idea why Fabric is puking?

If the same script/command works on Windows XP, then did you check if Windows 7 firewall or any sort-of-protection is not allowing your connection to go through? Try if the following works on interactive prompt:
from fabric.api import local
local('git archive')

Related

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.

Serverless Deploy Pip fails - Manual Pip succeeds

I wrote a python Serverless application.
I have a requirements.txt file that looks like:
git+https://github.com/Blah1/blah2#1.0#egg=blah3
oauth2==1.9.0.post1
When I run sls deploy or sudo sls deploy it fails saying:
Command "git clone -q https://github.com/Blah1/blah2.git /tmp/pip-install-jxs9quvp/blah2" failed with error code 128 in None
I've tried changing to ssh - same error.
I've tried to download it manually - works fine.
I've tried changing the command to use the local files I downloaded and
depending on the setup:
Fails with the same error code 128 in None error
Fails with a different error saying it can't find the file even though I verified path and

Yocto Project Bitbake Unexpected Termination

I just got my i.MX 8M Evaluation Kit and I followed the tutorial to make the system for my board.
I build the system on a host machine with Ubuntu 16.04 and I followed all instructions in Section-3 to set up my host machine.
I'm trying to build the Wayland image with OPTEE enabled so the commands are:
$ DISTRO=fsl-imx-wayland MACHINE=imx8mqevk source fsl-setup-release.sh -b build-wayland
Comment two SDL settings in local.conf: PACKAGECONFIG_append_pn-qemu-native = " sdl", PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
Enable OPTEE in local.conf
$ bitbake fsl-image-qt5-validation-imx
The issue happens after the "bitbake" command, which is the script would suddenly be stopped and the host machine would be suspended and required re-login. The bitbake command can be continued with "-k" parameter while the unknown termination and re-login process are really annoying to me.
By reviewing the bitbake log file bitbake-cookerdeamon.log, I found that every time before unexpected termination, the bitbake command generates the same logs:
Accepting [<socket.socket fd=7, family=AddressFamily.AF_UNIX,
type=SocketKind.SOCK_STREAM, proto=0, laddr=bitbake.sock>] Connecting
Running command ['updateConfig', ...]
Running command ['getVariable', 'BBINCLUDELOGS']
Running command ['getVariable', 'BBINCLUDELOGS_LINES']
Running command ['getSetVariable', 'BB_CONSOLELOG']
Running command ['getUIHandlerNum']
Running command ['setEventMask', ...]
Running command ['getVariable', 'BB_DEFAULT_TASK']
Running command ['setConfig', 'cmd', 'build']
Running command ['buildTargets', ['fsl-image-qt5-validation-imx'], 'build']
Running command ['stateForceShutdown']
Connecting Client
Disconnecting Client
No timeout, exiting.
Exiting
According to my current understanding, the above commands are only supposed to be executed after all tasks have been prepared. However, right now my host machine may invoke these commands during other tasks are still running, and this incorrect sequence leads to my unexpected termination issue.
I'm wondering if anyone runs to a similar problem or knows the solution to my issue?
Any suggestion is welcomed. Thank you in advance.
Simon
-----Supplemental Information
Here is the content of the configuration file fsl-imx-wayland.conf
# i.MX DISTRO for Wayland without X11
include conf/distro/include/fsl-imx-base.inc include
conf/distro/include/fsl-imx-preferred-env.inc
DISTRO = "fsl-imx-wayland"
# Remove conflicting backends DISTRO_FEATURES_remove = "directfb x11 " DISTRO_FEATURES_append = " wayland pam systemd"

Using Fabric in Python, trying to run tsch commands on remote bash server

Sorry if that Title is confusing. I am running a remote python script over the local network using Fabric:
#Path to file being run
env.source = 'c/yadda/yadda'
env.file = 'run_tests.py'
env.set = 'source ~USERNAME/ENVIRONMENT'
#create the task of changing the directory and running the test file from there
def link():
print('Connecting to remote computer and setting envirnoment...')
run ('%s' % env.set)
run ('cd %s && ./%s' % (env.source, env.file))
--- The env.set is used to bring the Python version up to a more recent version so that the file commands work (open with was causing problems).
THE PROBLEM is that the env.set has tsch commands such as setenv which, when run in the Bash shell, give errors. Is there any way that I can write the above to incorporate tsch commands?
Nevermind I solved it myself :)
Setting in the top:
env.shell = '/bin/rbash -l -c'
I got around this environment 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