JMeter execution on Unix based AWS server - amazon-web-services

We have an AWS Unix server where we have to do performance tests.
So is it possible to run jmeter on Unix aws servers ?
If it possible, please let me know

JMeter is based on Java, as a consequence it works on any OS that supports Java.
And Unix is one of those, so you can use it without any problem on :
Windows
MacOSX
Linux
Unix
We frequently use in on AWS without problem.

Just like on Windows, just use jmeter.sh instead of jmeter.bat. JMeter works wherever Java works so
Make sure you have installed Java 8 or later which is a pre-requisite for the latest (as of now) JMeter 4.0. Refer your Unix distribution documentation with regards to how to install Java
Install JMeter (just download it and unpack somewhere)
Create a JMeter script (you can do this on any operating system) using JMeter GUI
Copy the script and all the dependencies (CSV files, files used for uploads, etc.) to the Unix server
Run JMeter normally in command-line non-GUI mode like:
./jmeter.sh -n -t /path/to/testplan.jmx -l /path/to/results.jtl

Related

Run .sh script using Google Cloud SDK shell

I'm trying to automate deploying code to my 3 GCE Linux VM's. I read this article Scripting with gcloud: a beginner’s guide to automating GCP tasks, it shows how to make a script. Now I assume that means saving the code as a .sh file (it even has a shebang on top), now how do I run that. Do I type the script file name in the Google Cloud SDK Shell? I tried it, it does not seem to work. can someone help me? I will really appreciate.
Here is an image of my google cloud shell where I am trying to use the script files.
You're able to install Google Cloud SDK on variety of operation systems such as Linux, macOS and Windows. After that, you'll be able to use same commands like gcloud, gsutil and bq. Meanwhile, scripting relies on the command-line interpreters: you can use bash with Linux and macOS, but for Windows you should use cmd and PowerShell. You can run examples provided at the article, you've mentioned, and at the documentation Scripting gcloud CLI commands with bash on Linux and macOS, so the error messages you've got were expected. You can't run .sh scripts on windows naively, as it was mentioned by #Pievis at the comment section.
As a possible workaround you can install Windows Subsystem for Linux (WSL) for Windows 10 (usually you can choose between WSL2 and WSL1, but it depends on build version of your Windows 10) to get some interoperability between Windows and Linux.
If you need to transfer files to you VM instances please follow the documentation Transferring files to VMs.
If you are interested in automation with GCP, please have a look on the documentation Infrastructure as code to "automate repeatable tasks like provisioning, configuration, and deployments".

Programming the Pepper robot without "Choreography" software?

Usually the developer can use Softbanks own software Choreography to give programs to Pepper robot.
Isn't there a way to setup a different development environment? e.g. Access via SSH and creating Python scripts with a simple text editor and starting the script manually? It means writing and starting Python scripts for Pepper without using Choreography.
You can also use qibuild (pip install qibuild) : https://github.com/aldebaran/qibuild
It contains a qipkg command, just run
qipkg deploy-package path/to/your/file.pml --url USER#IP:/home/nao
A pml file is a project, it is created by Choregraph, or you can use this tool :
https://github.com/pepperhacking/robot-jumpstarter
in order to get a sample app.
Of course, using Choregraphe is not an obligation, you can use the different SDKs directly.
You can for instance create a python script on your computer, copy it on the robot
scp path/to/script/myscript.py nao#robotIp
And then ssh onto the robot and launch the script
ssh nao#robotIp
python myscript.py
You can also ssh onto the robot, create a script (using nano for instance) and launch it from there.
I've been using Pycharm Pro for 6 months and I am happy with it. You get automatic deployment and remote debugging. The most basic setup must still be done with Choregraphe, but it takes less than one minut.

File upload Selenium Web driver python in linux machine calling a remote machine

Hi I have scenario that needs to upload a file in a webpage. Actually I know that selenium will not support file upload scenario. But this can be done in python with external libraries such as AUTOIT, PYWINAUTO. But the challenge is i have to run my code in a linux server that is going to call a windows remote machine.
When i tried installing pywinauto in linux server i got an error in importing winreg library. Hence i dont know how to proceed further. Please help me out to solve this scenario.
Both AutoIt and pywinauto are Windows-only libraries (at least for now). If you need to automate file upload on Linux, consider using AT-SPI accessibility (say pyatspi2 package).
If it's a server without X and DBus, I think the question is about remote code execution from Linux to Windows. Good option for the SSH remote execution is Fabric (very pythonic & nice), but using Cygwin or OpenSSH might be an additional challenge for you. There are many other tools like Ansible etc.

AWS Lambda: How to use tools that must be installed first in linux?

I understand that AWS Lambda runs on the application layer of an isolated environment.
In many situations, functions need to use third-party tools that must be installed first on the linux machine. For example, a media processing function uses exiftool to extract metadata from image, so I install exiftool first.
Now I want to migrate the media processing code into AWS Lambda. My question is, how can I use those tools that I originally must install on linux? My code is written in Java, and exiftool is necessary.
To expand on Daniel's answer, if you wanted to bundle exiftool, you would follow steps 1 and 2 for Unix/Linux platforms from the official install instructions. You would then include exiftool and lib in your function's zip file. To run exiftool you would do something like:
const exec = require('child_process').exec;
exports.handler = (event, context, callback) => {
// './exiftool' gave me permission denied errors
exec('perl exiftool -ver', (error, stdout, stderr) => {
if (error) {
callback(`error: ${error}`);
return;
}
callback(null, `stderr: ${stderr} \n stdout: ${stdout}`);
});
}
Everything your Lambda function executes must be included in the deployment package you upload.
That means if you want to run Java code, you can reference other Java libraries. (Likewise, if you want to run Node.js code, you can reference other Node libraries.)
Regardless of the tools you use, the resulting .zip file must have the following structure:
All compiled class files and resource files at the root level.
All required jars to run the code in the /lib directory.
(source)
Or you can upload a .jar file.
exiftool, on the other hand, is a Perl command-line program. I suspect that on your local machine, you shell out from your Java code and run it.
You cannot do that in AWS Lambda. You need to find a Java package that extracts EXIF information (I am sure there are plenty to choose from) and include that in your deployment package. You cannot install software packages on Lambda.
https://aws.amazon.com/lambda/faqs/
Q: What languages does AWS Lambda support?
AWS Lambda supports code written in Node.js (JavaScript), Python, and Java (Java 8 compatible). Your code can include existing libraries, even native ones. Please read our documentation on using Node.js, Python and Java.
So basically you can call out to native processes if they are pre-installed but only from JavaScript and Java as the parent process.
To get a rough idea of what is installed have a look at what packages are installed:
https://gist.github.com/royingantaginting/4499668
This list won't be a 100% accurate, to do that you would need to look directly at the AMI image (ami-e7527ed7)
exiftool doesn't appear to be installed by default. I doubt the account running the lambda function would have enough rights to install anything globally but you could always bundle exiftool with your Node or Java function.
You may also want to have a look at lambdash (https://github.com/alestic/lambdash) which allows you to run command from your local command line on a remote lamdba instance
This can now be done using AWS Lambda Layers.
An example of how to prepare a layer for exiftool specifically can be found here:
https://gist.github.com/hughevans/6b8c57839b8194ba910428de4375794a

Using Rsync and the delta-transfer algorithm in an application

Is it possible to use a server running an Rsync daemon to update program files on the client machine? Is there a library for using as a connector when developing the Rsync client ?
I would not do that if the program files you update on the client machine are often or continuously running -in particular if they are server or daemon programs.
On Linux distributions, the package manager (i.e. dpkg on Debian) does a good job for upgrading programs (even for daemons). Can't you use it?
Writing inside a running program binary is error-prone.
There is a librsync on Linux.