VATIC Annotation Tool installation - "turkic setup --database" - unknown action setup - python

I'm trying to install VATIC Video Annotation Tool on Linux. I followed the instructions in README file twice, always failing to execute command:
$ turkic setup --database
which gives these two error messages:
No handlers could be found for logger "turkic.geolocation"
Error: Unknown action setup
Other turkic commands, e.g. turkic status --verify give the same error messages (for a given action name).
I also noticed that source file ~/vatic/public/index.html contains links to stylesheets and scripts in turkic folder src="/turkic/file_name", which can't be reached. Their true location is in ~/turkic/turkic/public.
Any ideas what can be wrong?

You should go into vatic folder when executing any commands starting with turkic.
Only inside vatic folder "actions" will be recognized.
Make sure that you issue the symbolic link command:
$ turkic setup --public-symlink

Related

How to run a executable with command line in Python?

I´ve installed this package: https://github.com/retostauffer/PyGFSV2, with pip. This package comes with two executables (GFSV2_get and GFSV2_bulk). But, i don´t know how to open executables in Python.
So, after instlation, the package author recomend try the installation by calling:
GFSV2_get --step 12 24 --level 700 850 --param tmp_pres --date 2005-01-01
So, i put in Anaconda Prompt the next:
(base) C:\Users\vrida>CD C:\Users\vrida\anaconda3\Scripts
(base) C:\Users\vrida\anaconda3\Scripts>python GFSV2_get --step 12 24 --level 700 850 --param tmp_pres --date 2005-01-01
But, it didn´t work. Appear this:
# DEBUG Loading default config file from package source.
# INFO Config file read, return.
# INFO Processing date 2005-01-01 00Z
# INFO Downloading inventory information data
# DEBUG Reading ftp://ftp.cdc.noaa.gov/Projects/Reforecast2/2005/200501/2005010100/mean/latlon\tmp_pres_2005010100_mean.grib2.inv
# ERROR Problems reading file, reason: "ftp error: URLError("ftp error: error_perm('550 Failed to change directory.')")".
# ERROR Could not download inventory file! Skip this.
# INFO Inventory empty, skip this file
# INFO Downloading inventory information data
# DEBUG Reading ftp://ftp.cdc.noaa.gov/Projects/Reforecast2/2005/200501/2005010100/sprd/latlon\tmp_pres_2005010100_sprd.grib2.inv
# ERROR Problems reading file, reason: "ftp error: URLError("ftp error: error_perm('550 Failed to change directory.')")".
# ERROR Could not download inventory file! Skip this.
# INFO Inventory empty, skip this file
I´m beginner in Python. So i have two questions:
1 - How to run these executables, for example with Anaconda Prompt?
2 - Could anyone make the download of the package, after try the instalation and, if sucessfull, tell me how can i make the same?
I think you should contact the maintainer of the package. apparently the library tries to download some file via ftp, using the system file separator, \ in your case (since you are using windows), instead of /:
ftp://ftp.cdc.noaa.gov/Projects/Reforecast2/2005/200501/2005010100/mean/latlon\tmp_pres_2005010100_mean.grib2.inv
the file is accessible via anonymous ftp access using a standard ftp client. so it should be an issue with the python library.

Makefile on Windows 10 - file not found

After some time I finally managed to successfully install python and pip and run it on my machine using Visual Studio Code.
I am working in virtual environment in python and we have a Makefile with following statement:
test:
source .env && PYTHONPATH=. PY_ENV=testing py.test ${ARGS} --duration=20
File .env lives in the main directory next to Makefile. It contains some environmental variables needed for testing certain APIs.
When I take the line out of the file and run it in my terminal, everything works fine and all tests are running etc.
However if I call the following: make test I am getting this error:
$ make test
source .env && PYTHONPATH=. PY_ENV=testing py.test --duration=20
/usr/bin/sh: line 0: source: .env: file not found
make: *** [test] Error 1
(venv)
To me it looks like when running this command from within Makefile it can't see the .env file but have no idea how to solve it.
The source command isn't looking up the file in the current working directory. As mentioned in man source:
Read and execute commands from filename in the current shell
environment and return the exit status of the last command executed
from filename. If filename does not contain a slash, filenames in
PATH are used to find the directory containing filename.
Change the file path like so:
test:
source ./.env && PYTHONPATH=. PY_ENV=testing py.test ${ARGS} --duration=20
Note that this error does not occur in bash version < 4. This is due to an implementation bug when run under POSIX mode (what make uses, since its default shell is sh, which is usually bash --posix). The correct behaviour was first mentioned in the documentation of bash-2.05 (revision 28ef6c31, file doc/bashref.info):
When Bash is not in POSIX mode, the current directory is searched if
FILENAME is not found in `$PATH'.
These older versions searched the current directory regardless of POSIX mode. It was only in bash-4.0-rc1 (revision 3185942a, file general.c) that this was corrected. Running git diff 3185942a~ 3185942a general.c outputs this section:
## -69,6 +69,7 ## posix_initialize (on)
if (on != 0)
{
interactive_comments = source_uses_path = expand_aliases = 1;
+ source_searches_cwd = 0;
}

Cannot find ansible.cfg after installation on Mac OS

My app installs ansible==2.2.1.0 as part of its requirements and I'd like it to use a library I have in a specific location.
I try to find the ansible.cfg file but can't find it anywhere and not sure where it's best to be put.
I am using Mac OS.
EDIT:
I set up a config file at: /Users/<myuser>/.ansible.cfg and when I run the ansible-playbook with -vvv it shows:
Using /Users/<myuser>/.ansible.cfg as config file
But I am getting this errors and warnings for some reason:
[WARNING]: Host file not found: /etc/ansible/hosts
[WARNING]: provided hosts list is empty, only localhost is available
ERROR! conflicting action statements
Thanks!
From the Ansible docs:
Changes can be made and used in a configuration file which will be processed in the following order:
ANSIBLE_CONFIG (an environment variable)
ansible.cfg (in the current directory)
.ansible.cfg (in the home directory)
/etc/ansible/ansible.cfg
That said, these locations need not be populated for Ansible to function. But you should look for them there.
If your application is running Ansible, and you would like to specify the contents of the config, just create an ansible.cfg in the executing directory. If you are looking to manage the config, just look for them in that order and manage as you see fit. You could even create each of those files and Ansible will look for them. You may then determine which ansible.cfg is being used by adding the -vv argument to your ansible or ansible-playbook calls.
The warnings and errors you are seeing are unrelated to the Ansible config not being found.
[WARNING]: Host file not found: /etc/ansible/hosts
When you call ansible or ansible-playbook, add --inventory path/to/your/inventory. This will also resolve the warning below.
[WARNING]: provided hosts list is empty, only localhost is available
ERROR! conflicting action statements
This is typically caused by having multiple module calls within a single task item. Just split them up:
- name: make some files
file: state=directory dest=/etc/foo
file: src=foo/bar dest=/etc/foo/bar
Should be
- name: create a dir
file: state=directory dest=/etc/foo
- name: create a file
file: src=foo/bar dest=/etc/foo/bar

Python module import failure in Jenkins

I have a project I'm trying to test and run on Jenkins. On my machine it works fine, but when I try to run it in Jenkins, it fails to find a module in the workspace.
In the main workspace directory, I run the command:
python xtests/app_verify_auto.py
And get the error:
+ python /home/tomcat7/.jenkins/jobs/exit103/workspace/xtests/app_verify_auto.py
Traceback (most recent call last):
File "/home/tomcat7/.jenkins/jobs/exit103/workspace/xtests/app_verify_auto.py", line 19, in <module>
import exit103.data.db as db
ImportError: No module named exit103.data.db
Build step 'Execute shell' marked build as failure
Finished: FAILURE
The directory exit103/data exists in the workspace and is a correct path, but python can't seem to find it.
This error exists both with and without virtualenv.
It's may caused by your PATH setting not right in jenkins environment.In fact , the environments for your default user and jenkins-user are not the same.
You may try to find what are the PATH and PYTHONPATH in your jenkins-user environments .
Try to run "shell commands" in jenkins "echo $path" and so on to see what's them are.
In most of time , you need to set the PATH by yourself.
You may reference this answer.
Jenkins: putting my Python module on the PYTHONPATH
Faced the same issue.
For others who are reading this, Run the build in your master node. It fixed the problem for me.
Running the build in the slave node doesn't give proper access to all the python modules and other commands such as jq to the workspace.

How do I use Python file in Nagios?

I'm trying to get a response from Nagios by using the following Python code and instructions:
http://skipperkongen.dk/2011/12/06/hello-world-plugin-for-nagios-in-python/
From some reason I never get to have OK from Nagios and it's always comes back with the message: Return code 126 is out of bounds - plugin may be missing
I installed nagiosplugin 1.0.0, and still nothing seems to be working
In parallel I have some other services (not python files) that work e.g. http check, current users, and SSH
What am I doing wrong? I'm trying to solve that for few days already
Getting Nagios to utilize your new plug-in is quite easy. You should make changes to three files and restart Nagios — that’s all it takes.
The first file is /etc/nagios/command-plugins.cfg (leave comment please if you know path to this file or analog in ubuntu). Assumed that plugin file is placed in /usr/lib/nagios/plugins/ directory:
command[check_hello_world]=/usr/lib/nagios/plugins/check_helloworld.py -m 'some message'
Drop down one directory to /etc/nagios/objects/commands.cfg (for ubuntu user should create cfg file in that dir /etc/nagios-plugins/config/):
define command {
command_name check_hello_world
command_line $USER1$/check_hello_world.py -m 'some message'
}
Save the file and open up /etc/nagios/objects/localhost.cfg (in ubuntu path to service definition files located in /etc/nagios3/nagios.cfg and by default cfg_dir=/etc/nagios3/conf.d. So, to define new service in ubuntu user should create cfg file in that dir, for example hello.cfg). Locate this section:
#
# SERVICE DEFINITIONS
#
and add new entry:
define service {
use local-service ; Name of service template to use
host_name localhost
service_description Check using the hello world plugin (always returns OK)
check_command check_hello_world
}
All that remains is to restart Nagios and to verify that plug-in is working. Restart Nagios by issuing the following command:
/etc/init.d/nagios restart
http://www.linux-mag.com/id/7706/
ubuntuforums.org - Thread: My Notes for Installing Nagios on Ubuntu Server 12.04 LTS
I had to prepend the path to python2.7 even though the shebang in the file specified it.
In the command definition I had this:
command_line /usr/local/bin/python2.7 $USER1$/check_rabbit_queues.py --host $HOSTADDRESS$ --password $ARG1$
Even though the top of the actual python file had:
#!/usr/bin/env python2.7
Even though the script executed and returned just fine from the command line without specifying the interpreter.
Nothing else I tried seemed to work.

Categories