How to set Fileinput directory value from properties? - ibm-integration-bus

If my flow is File Input -> Compute Node -> File Output, how can I set the File Input directory value based on a User Defined Property? I will have a different file drop directory for dev, qa and prod and don’t want this hard coded anywhere. If it cannot be done using my User Defined Properties, how else can I accomplish this?

Create configurable properties per environment and define the input directory there.
Properties for dev:
# File: yourapp-dev.properties
yourflow#File Input.inputDirectory = ./yourapp/dev/in
Properties for qa:
# File: yourapp-qa.properties
yourflow#File Input.inputDirectory = ./yourapp/qa/in
Apply the properties per environment. For dev it would be:
mqsiapplybaroverride -b yourapp.bar -p yourapp-dev.properties -r
Now you can deploy yourapp.bar to the dev environment.

Related

how to set default verbosity in ansible.cfg

I want to set default verbosity level in ansible. I set default_verbosity=1 in anisble.cfg but this is not working. If I set environment variable ANSIBLE_VERBOSITY=1 then I can see verbose level 1 output for my running tasks.
As per my current requirement, I want to set this value in ansible.cfg.
Can anyone help me on this?
Use verbosity instead of default_verbosity in ansible.cfg file as:
$ cat ansible.cfg
[defaults]
verbosity = 1
verbosity can be 0|1|2|3|4 representing None|-v|-vv|-vvv|-vvvv.
Assuming, the config file is kept under specific locations ansible looks into.
ansible-config list can also be used to list all the available configuration file settings.

Failing to open a file which should be in the base path

I have a Go project (bazel-remote) that tries to read a yaml file passed in the command line, when built with bazel. This yaml file sits in the same location from where I run the bazel run command.
But it fails to run because os.Open fails with no such file or directory.
I printed the basePath using os.Getwd, because someone suggested that my basePath might be set wrong. But my basePath is set to a location in my /private/var/tmp/ where the bazel objects are created and stored:
/private/var/tmp/bazel/312feba8ddcde6737ae7dd7ef9bc2a5a/execroot/main/bazel-out/darwin-fastbuild/bin/darwin_amd64_static_pure_stripped/bazel-remote.runfiles/main'
How do I set my basePath correctly? Why is my basePath set to where it is?
Binaries started with bazel run are executed in an internal Bazel directory. They'll have access to "runfiles", which are files mentioned in the data attribute of the binary rule or its dependencies. For example, if you have a rule like the one below, you'll be able to read foo.txt, but not bar.txt or other files:
load("#io_bazel_rules_go//go:def.bzl", "go_binary")
go_binary(
name = "hello",
srcs = ["hello.go"],
data = ["foo.txt"],
)
Note that the working directory of the binary corresponds to the repository root directory, not the directory where the binary is defined. You can debug with os.Getwd and filepath.Walk.
You mentioned you wanted to access a yaml file passed in on the command line though. Presumably, you want to be able to access any file the user passes in, not just files mentioned in the data attribute. For this case, take a look at the BUILD_WORKING_DIRECTORY environment variable (bazel run sets this). That gives the path to the directory where bazel run was invoked. Also, BUILD_WORKSPACE_DIRECTORY is the path to the workspace root directory.

Make configuration file point to an existing file

qrouter [-c < config_name>] [options] < basename>
where <basename> is without an extension.
File <basename>.def is assumed to exist
and to define cell placement and netlist
information. File <config_name> is
assumed to exist and contains basic
routing parameters, or points to a LEF
file containing detailed routing parameters.
If this option is not specified, then the
default configuration file name of "route.cfg"
is used.
How to write a .cfg file that points to an existing file?
The commend is used to run an open source VLSI routing tool called Qrouter, an example .cfg file can be like below:
lef /usr/lib/ibm01.lef

Changing configuration options for Marathon

I'd like to change set various configuration options for Marathon, and I'm unsure how to do this. For example, I'd like to add --event_subscriber http_callback to the launch command.
For each configuration you can create a file in the directory /etc/default/marathon where the filename is the name of the option and a single line in the file containing the value for that option.
Eg. Make a file /etc/default/marathon/event_subscriber that contains the line "http_callback"
This also works for mesos.
Actually the directory has to be /etc/marathon/conf. This is valid for 0.11.1.

Writing to a file named with variables in distributed JMeter testing

Okay I've been having an issue with writing results to folders in JMeter.
I have set 2 variables, one for the name of the test and one for the submit date. I want the reports to be written to the folder named with these two variables.
Here's the variables:
TestRun = "Name of test"
DateRun = $__{time(dd-MMM-yyyy HH.mm.ss)}
The path of the folder to be written to looks like this:
C:\Tests\TestEnvironment\Results\\${TestRun}${DateRun}\file.csv
When I run it on the master machine, it's fine. It saves to the correct file and folder path, and ends up looking something like this:
C:\Tests\TestEnvironment\Results\Test Run 1 - 08-May-2014 08.55.47\file.csv
However, when I run it on remote machines, it saves it literally as below:
C:\Tests\TestEnvironment\Results\${TestRun}${DateRun}\file.csv
So I end up with a folder named "${TestRun}${DateRun}"
Am I missing something blindingly obvious, or is this an actual JMeter issue?
Thanks!
As per JMeter help:
-G, --globalproperty <argument>=<value>
Define Global properties (sent to servers)
e.g. -Gport=123
or -Gglobal.properties
You need to use -G key so your variables could be distributed across remote clients.
so something like:
jmeter -r -n GTestRun=SomeName -GDateRun=SomeTime -t /path/to/your/plan
should help.
Alternatively you can create a .properties file and pass it to remote JMeter Engines via the same "-G" option.
I expect that if you want to use JMeter __time() function you'll need to wrap it with __eval, elsewise it will be treated as a string. Alternatively you can use operating system commands to retrieve current date and time.
See Apache JMeter Properties Customization Guide for more information on dealing with JMeter Properties.

Resources