ERROR: cluster.name is not a recognized option in elasticsearch - python

I am trying to set up elasticsearch with python and as part of that I am trying to do a search from youtube data (as a sample).
I am using Windows 10 X64 machine with elasticsearch 6.5.4.
When I run the following command, I am getting an error
PS C:\Users\XXXXX\elasticsearch-6.5.4\bin> .\elasticsearch cluster.name=youtube node.name=video
starts elasticsearch
- Option Description
------ -----------
-E <KeyValuePair> Configure a setting
-V, --version Prints elasticsearch version information and exits
-d, --daemonize Starts Elasticsearch in the background
-h, --help show help
-p, --pidfile <Path> Creates a pid file in the specified path on start
-q, --quiet Turns off standard output/error streams logging in console
-s, --silent show minimal output
-v, --verbose show verbose output
ERROR: Positional arguments not allowed, found [cluster.name=youtube, node.name=video]

It is mentioned in the usage/help info that you need to pass -E to set configurations:
-E Configure a setting
It is also mentioned in their Getting Started / Installation steps:
As mentioned previously, we can override either the cluster or node
name. This can be done from the command line when starting
Elasticsearch as follows:
./elasticsearch -Ecluster.name=my_cluster_name -Enode.name=my_node_name

Related

"bin/bash: python: command not found" returned when running docker image

Here is the docker run output:
hausey#ubuntu:~/niso2-jxj934$ docker run niso2-jxj934
Test version: 15:59, Mar 24th 2020
Question 1: Evaluation of expression.
Command failed: /bin/bash -c "python /bin/jxj934.py -question 1 -expr \"(ifleq (ifleq -1.11298616747 1.63619642199 (sub -1.11298616747 -1.11298616747) 1.7699684348) (add (exp -0.822479932786) 1.39992604386) (add -1.11298616747 (exp 0.385042309638)) 0.205973267133)\" -n 10 -x \"-0.168958230447 -0.131749160548 0.0971246476126 1.8706205565 -0.464122426299 2.35887369763 -0.375948313434 -0.613901105864 0.411326743135 -0.149276696072\"" Exit status: exited with code 127 stderr: /bin/bash: python: command not found
Here is the Dockerfile:
FROM pklehre/niso2020-lab2-msc
ADD jxj934.py /bin
CMD ["-username","jxj934", "-submission", "python /bin/jxj934.py"]
Here is check for python:
hausey#ubuntu:~/niso2-jxj934$ which python
/usr/bin/python
Is that related to the PATH of python?
Usually, it is related to the value of PATH but, specifically, that image only has python3. In other words, looking through the filesystem with
find / -name -type f "python*"
Look for regular files named "python*" in /
There were only python3 results.
...
/usr/bin/python3.8
/usr/bin/python3.7
...
A quick solution is to specify python3 in your CMD line (python3 /bin/jxj934.py). Another is to add a soft link (ln -s /usr/bin/python /usr/bin/python3.8). The best solution is to solve it using the package manager. Then again, that depends if you're in control of the Dockerfile + image.
When you queried which python, you did so on your local machine. The container runs in a different filesystem namespace than yours and with a completely different terminal. The container will behave differently than your machine and any such investigations will yield relevant results only when run within the container.
A little unrelated to your question but it might serve you.
docker run has a --entrypoint option that allows you to override the image's entrypoint. You can ask for bash and explore the container.
docker run --it --entrypoint=bash pklehre/niso2020-lab2-msc
Note that bash has to be in the $PATH.

Process finished with exit code 2

Whenever I am trying to run a object detection program in pycharm, the following error occurs (see the trace). Could you please help to figure out, how to fix it?
C:\Users\Dell\venv\Scripts\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.4\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 11093 --file C:/Users/Dell/Desktop/image.py
pydev debugger: process 2648 is connecting
Connected to pydev debugger (build 183.5429.31)
usage: image.py [-h] -i IMAGE -p PROTOTXT -m MODEL [-c CONFIDENCE]
image.py: error: the following arguments are required: -i/--image, -p/--prototxt, -m/--model
Process finished with exit code 2
Actually i am trying to run the code in the following page
https://www.pyimagesearch.com/2017/09/11/object-detection-with-deep-learning-and-opencv/
My question is where should i copy and paste .......python deep_learning_object_detection.py \
--prototxt MobileNetSSD_deploy.prototxt.txt \
--model MobileNetSSD_deploy.caffemodel --image images/example_01.jpg
In PyCharm, in the Run menu, look for Edit configurations...
Each time you run a new script, a run configuration is created for it and it is here that you can provide command line parameters in the Parameters: box.
You probably only want to past the parameters section there, not the script name, so:
\ --prototxt MobileNetSSD_deploy.prototxt.txt \ --model MobileNetSSD_deploy.caffemodel --image images/example_01.jpg
Another issue you may run into is what working directory your script needs to run in. You can change it from the same dialog, under Working directory:. You'll find that you'll rarely need to change any of the other fields in this dialog, although I would recommend giving it a name that's sensible to you under Name: - by default it's named after the script file it is running.

How do I run sumo-gui on instant-veins-4.7.1-i1.ova

I downloaded instant veins 4.7.1-i1 (a virtual appliance for running Veins) from the link below:
https://veins.car2x.org/download/instant-veins-4.7.1-i1.ova
But in my simulation, I need to run the sumo-gui, while the connection (sumo-launchd.py) in the virtualBox only runs the sumo. I tried to modify that a bit,
but i can't.
Can you help me??
You can start the sumo-launchd with different parameters. The default configuration (shortcut in the "Activities" menu) executes the sumo-launchd.py with the -vv parameter.
/home/veins/src/veins/sumo-launchd.py -vv
To use sumo-gui, you can use the following command in a terminal:
python /home/veins/src/veins/sumo-launchd.py -vv -c sumo-gui

Snakemake: missing file operand when using cluster

I am deploying a snakemake workflow on a PBS cluster (PBSpro). I'm running into a problem where shell commands run on cluster nodes are failing due to missing arguments/operands to the shell command. Below is a minimal example that can reproduce the behavior I'm seeing:
rule all:
input: 'foo.txt'
rule run_foo:
output: 'foo.txt'
shell: 'touch {output}'
Run from the command line as:
snakemake all
The workflow runs to completion without any errors. However, run from the command line as:
snakemake all --jobs 1 --cluster "qsub -l select=1:ncpus=1 -l walltime=00:05:00 -A $PROJECT -q share -j oe"
The workflow fails and the produces a cluster log such as this:
Error: Image not found
Error in job run_foo while creating output file foo.txt.
RuleException:
CalledProcessError in line 7 of /glade2/scratch2/jhamman/Snakefile:
Command 'touch foo.txt' returned non-zero exit status 1.
File "/glade2/scratch2/jhamman/Snakefile", line 7, in __rule_run_foo
File "/glade/u/home/jhamman/anaconda/envs/storylines/lib/python3.6/concurrent/futures/thread.py", line 56, in run
Exiting because a job execution failed. Look above for error message
What appears to be happening is that the arguments to the command (in this case touch) are not applied, despite being listed traceback.
Is there a trick to passing shell commands to a cluster via snakemake that I am missing?
As it turns out, I was using a fairly old version of snakemake. For some reason, conda had pinned my version. In any event, a manual upgrade to the latest stable version of snakemake seems to have resolved this issue.

Paver Unknown task error

I am getting started with paver and I am not getting a basic command to run, I am not sure what I am missing.
Docs
Link to the documentation
Installation
pip install paver
After installation I am able to execute paver in commandline.
---> paver.tasks.help
Usage: paver [global options] taskname [task options] [taskname [taskoptions]]
Options:
--version show program's version number and exit
-n, --dry-run don't actually do anything
-v, --verbose display all logging output
-q, --quiet display only errors
-i, --interactive enable prompting
-f FILE, --file=FILE read tasks from FILE [pavement.py]
-h, --help display this help information
--propagate-traceback
propagate traceback, do not hide it under
BuildFailure(for debugging)
-x COMMAND_PACKAGES, --command-packages=COMMAND_PACKAGES
list of packages that provide distutils commands
Tasks from paver.misctasks:
generate_setup - Generates a setup.py file that uses paver behind the scenes
minilib - Create a Paver mini library that contains enough for a simple
pavement.py to be installed using a generated setup.py
paverdocs - Open your web browser and display Paver's documentation.
Tasks from paver.tasks:
help - This help display.
paverlib > tasks.py
#task
def testpaver():
from nose.tools import set_trace;set_trace()
paverlib > _ init _.py
import tasks
Run
paver testpaver
Build failed: Unknown task: testpaver
What I am missing?
By default, Paver looks for pavement.py as a source for task definitions.
Have you tried putting testpaver in there?

Categories