I am trying to simulate Hadoop YARN SLS (Scheduling Load Simulator) with the sources given in Hadoop's GitHub and the SLS source files are located in [REF-1].
Here the step I have done :
Using VMWARE as the Host.
Using Ubuntu 14.04
Installing Hadoop v 2.6.0 [REF-2]
User : hduser | group : hadoop
Installing any needed packages (e.g. maven)
Get the clonning file of Hadoop's GitHub [REF-1]
Syntax : git clone https://git.apache.org/hadoop.git
Result : hduser#ubuntu:~/hadoop$
I made the changes inside directory hduser#ubuntu:~/hadoop/hadoop-tools$
FYI : I used the codes from MaxinetSLS [REF-3] as the way I compile the source files. The SLS source files can be downloaded by using this syntax in Linux : git clone https://github.com/wette/netSLS.git. By default, I can run this program with no error. The SLS Simulator can work perfectly.
From MaxiNetSLS's source files, I copied this files below into my work in hduser#ubuntu:~/hadoop/hadoop-tools$ :
netSLS/generator > hduser#ubuntu:~/hadoop/hadoop-tools$
netSLS/html > hduser#ubuntu:~/hadoop/hadoop-tools$
netSLS/sls.sh > hduser#ubuntu:~/hadoop/hadoop-tools$
netSLS/sls/hadoop/ > hduser#ubuntu:~/hadoop/hadoop-tools/hadoop-sls$
Then, I modified some files as follows.
netSLS/sls.sh
#!/usr/bin/env bash
function print_usage {
echo -e "usage: sls.sh TraceFile"
echo -e
echo -e "Starts SLS with the given trace file."
}
if [[ -z $1 ]]; then
print_usage
exit 1
fi
TRACE_FILE=$(realpath $1)
if [[ ! -f ${TRACE_FILE} ]]; then
echo "File not found: ${TRACE_FILE}"
print_usage
exit 1
fi
cd hadoop-sls
OUTPUT_DIRECTORY="/tmp/sls"
mkdir -p ${OUTPUT_DIRECTORY}
ARGS="-inputsls ${TRACE_FILE}"
ARGS+=" -output ${OUTPUT_DIRECTORY}"
ARGS+=" -printsimulation"
mvn exec:java -Dexec.args="${ARGS}"
hduser#ubuntu:~/hadoop/hadoop-tools/hadoop-sls/pom.xml$
[REF-4]
hduser#ubuntu:~/hadoop/hadoop-tools$ nano hadoop-sls/hadoop/etc/hadoop/sls-runner.xml
[REF-5]
Next step, I try to :
Compile the script using hduser#ubuntu:~/hadoop/hadoop-tools/hadoop-sls$ mvn compile
Compiled with no error (mvn_compile_perfect.jpg).
Run the program using hduser#ubuntu:~/hadoop/hadoop-tools$ ./sls.sh generator/small.json
Got the error here (error_json_compile.jpg). :(
Until now, I have went through some information related with similar problems I faced [REF-6] and tried it, but I still get the same problem. I guess I think the problem is in the ~/hadoop/hadoop-tools/hadoop-sls/pom.xml I mistakenly modified. I have lack of knowledge with Linux Environment. :(
References : http://1drv.ms/21zcJIH (txt file)
*Cannot post more than 2 links in my post. :(
Related
I am trying to generate java files from asn1 file using the below in my android project and facing error in generating the files in Mac OS and in window it worked fine.
org.openmuc:jasn1:1.9.0
org.openmuc:jasn1-compiler:1.9.0
Below is the bash file
#!/bin/bash
JARS_LOCATION="../build/libs-all"
MAIN_CLASS="org.openmuc.jasn1.compiler.Compiler"
SYSPROPS=""
PARAMS=""
SCRIPT_HOME=`dirname $0`
CLASSPATH=$(JARS=("$SCRIPT_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}")
for i in $#; do
if [[ $i == -D* ]]; then
SYSPROPS="$SYSPROPS $i";
else
PARAMS="$PARAMS $i";
fi
done
java $SYSPROPS -cp $CLASSPATH $MAIN_CLASS $PARAMS
and the above bash file will be called from my projects build.gradle file.
Below is the final command will be executed from the bash. Shortened the file paths for easy understanding.
java -cp "/libs/antlr-2.7.7.jar:/libs/jasn1-1.9.0.jar:/libs/jasn1-compiler-1.9.0.jar" org.openmuc.jasn1.compiler.Compiler -p com.test.package.asn1 -f /asn1def/asn1/RSPDefinition.asn /asn1def/asn1/PKIX1Explicit88.asn /asn1def/asn1/PKIX1Implicit88.asn -o /asn1def/build/generated/source/java
Below is the error I am getting
Generated code will be saved in /asn1def/build/generated/source/java
Parsing "/asn1def/asn1/RSPDefinition.asn"
Parsing "/asn1def/asn1/PKIX1Explicit88.asn"
Parsing "/asn1def/asn1/PKIX1Implicit88.asn"
Generating classes for module "PKIX1Implicit88"
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
at org.openmuc.jasn1.compiler.HexConverter.toShortHexString(HexConverter.java:63)
at org.openmuc.jasn1.compiler.HexConverter.toShortHexString(HexConverter.java:59)
at org.openmuc.jasn1.compiler.HexConverter.appendShortHexString(HexConverter.java:99)
at org.openmuc.jasn1.compiler.HexConverter.appendHexString(HexConverter.java:108)
at org.openmuc.jasn1.compiler.HexConverter.toHexString(HexConverter.java:9)
at org.openmuc.jasn1.compiler.BerClassWriter.writeEncodeTag(BerClassWriter.java:2169)
at org.openmuc.jasn1.compiler.BerClassWriter.writeSequenceOrSetEncodeFunction(BerClassWriter.java:1107)
at org.openmuc.jasn1.compiler.BerClassWriter.writeSequenceOrSetClass(BerClassWriter.java:731)
at org.openmuc.jasn1.compiler.BerClassWriter.writeConstructedTypeClass(BerClassWriter.java:493)
at org.openmuc.jasn1.compiler.BerClassWriter.translateModule(BerClassWriter.java:194)
at org.openmuc.jasn1.compiler.BerClassWriter.translate(BerClassWriter.java:133)
at org.openmuc.jasn1.compiler.Compiler.main(Compiler.java:89)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 12 more
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':asn1def:compileAsn'.
> Process 'command '/asn1def/run-scripts/jasn1-compiler'' finished with non-zero exit value 1
I have the main class in the jasn1-compiler-1.9.0.jar file in the libs folder. The same generate files in windows but in Mac it is not working. The difference in windows & Mac is Java version. Mac has Java 11 & windows has Java 1.8. I also tried adding the JDK 1.8 location as below at the end of above code.
-Dorg.gradle.java.home=/Users/Shared/Jenkins/.jenkins/tools/hudson.model.JDK/JDK_1_8
Can anyone help me to point out what's missing?
Finally I found the answer. The error was happened because of the Java version in Mac, it has Java 11 and it didn't support javax xml bind. So I installed the JDK 1.8 in the mac machine and use that path in the bash file as below before the java execution line in bash file.
export JAVA_HOME=/usr/java/jdk1.8.161/
It may useful for someone.
We have small array of Greenplum database.
When trying to read External table in it.
Getting error
proddb=# select count(*) from ext_table;
ERROR: external table gphdfs protocol command ended with error. sh: java: command not found (seg0 slice1 sdw:
40000 pid=8675)
DETAIL:
Command: 'gphdfs://path/to/hdfs External table revenuereport_stg0, file gphdfs://Path/to/hdfs
We tried :
Checked Java env on greenplum master host.
Also checked , Setting up - the parameters for GPDB
[gpadmin#admin ~]$ gpconfig -c gp_hadoop_home -v "'/usr/lib/gphd'"
[gpadmin#admin ~]$ gpconfig -c gp_hadoop_target_version -v "'gphd-2.0'"
But it is failing with this error
[gpadmin#mdw ~]$ gpconfig -c gp_hadoop_home -v "'/usr/lib/gphd'"
20170123:02:02:04:017762 gpconfig:mdw:gpadmin-[ERROR]:-failed updating the postgresql.conf files on host: sdw
20170123:02:02:04:017762 gpconfig:mdw:gpadmin-[ERROR]:-failed updating the postgresql.conf files on host: mdw
20170123:02:02:09:017762 gpconfig:mdw:gpadmin-[ERROR]:-finished with errors
Therefore ,Test for HDFS Access from greenplum host is not working.
Checked if HDFS is accessible from any of the segment servers
[gpadmin#sdw1 ~]$hdfs dfs -ls hdfs://hdm2:8020/
Any help on it would bemuch appreciated !
It looks like a path issue to me .Please set right JAVA_HOME in hadoop-env.sh file
Also ,Please have a look into the following articles for better understanding on configuring gphdfs with gpdb .
https://discuss.pivotal.io/hc/en-us/articles/202635496-How-to-access-HDFS-data-via-GPDB-external-table-with-gphdfs-protocol
https://discuss.pivotal.io/hc/en-us/articles/203083906-Understanding-GPHDFS-Configurations
https://discuss.pivotal.io/hc/en-us/articles/221492507-One-time-HDFS-Protocol-Installation-for-GPHDFS-access-to-HDP-2-x-cluster
Thanks
Pratheesh Nair
export JAVA_HOME=/usr/local/jdk18
export HADOOP_HOME=/opt/apps/hadoop
export GP_JAVA_OPT='-Xmx1000m -XX:+DisplayVMOutputToStderr'
export PATH=$JAVA_HOME/bin:$PATH
export KRB5CCNAME=$GP_SEG_DATADIR/gpdb-gphdfs.krb5cc
JAVA=$JAVA_HOME/bin/java
java_home 和 hadoop_home 要给具体数值,置于最前面,写成从环境变量获取JAVA_HOME=$JAVA_HOME,GP处理时获取会为空值。
I've successfully setup a project which uses Travis CI to for builds and tests. Now I'm trying to add Coverity Scan.
I created a branch called coverity_scan and set it be used for coverity builds. After I push a commit to this branch I can see in Travis CI build console that Coverity tool starts doing its job:
Coverity Scan analysis selected for branch coverity_scan.
Coverity Scan analysis authorized per quota.
...
Running Coverity Scan Analysis Tool...
The Travis build succeeds and in Coverity build-log.txt file I see this:
2016-10-06T21:02:39.132946Z|cov-build|2665|info|>
2016-10-06T21:02:39.132946Z|cov-build|2665|info|> Build time (cov-build overall): 00:01:36.812431
2016-10-06T21:02:39.132946Z|cov-build|2665|info|>
2016-10-06T21:02:39.134719Z|cov-build|2665|info|> Build time (Java emits total): 00:01:07.595656
2016-10-06T21:02:39.134719Z|cov-build|2665|info|>
2016-10-06T21:02:39.134719Z|cov-build|2665|info|>
2016-10-06T21:02:39.134763Z|cov-build|2665|info|> Emitted 30 Java compilation units (100%) successfully
2016-10-06T21:02:39.134763Z|cov-build|2665|info|> [WARNING] Recoverable errors were encountered during 1 of these Java compilation units.
2016-10-06T21:02:39.134763Z|cov-build|2665|info|>
2016-10-06T21:02:39.134763Z|cov-build|2665|info|> 30 Java compilation units (100%) are ready for analysis
2016-10-06T21:02:39.134763Z|cov-build|2665|info|> For more details, please look at:
2016-10-06T21:02:39.134763Z|cov-build|2665|info|> /home/travis/build/Edvinas01/chat-rooms/server/cov-int/build-log.txt
However after this finishes, I do not see any submitted builds or changes in projects Coverity dashboard. The project status stays on pending.
I've followed this guide and setup my .travis.yml file like this:
language: java
jdk:
- oraclejdk8
before_script:
- cd server
- chmod +x gradlew
script:
# Run tests when not on coverity branch.
- if [ ${COVERITY_SCAN_BRANCH} != 1 ]; then
./gradlew check;
fi
cache:
directories:
- ~/.gradle
after_success:
# Upload coveralls when not on coverity branch.
- if [ ${COVERITY_SCAN_BRANCH} != 1 ]; then
./gradlew cobertura coveralls;
else
cat cov-int/build-log.txt;
fi
notifications:
email:
on_success: change
env:
matrix:
- TERM=dumb
global:
# COVERITY_SCAN_TOKEN
- secure: "<TOKEN>"
before_install:
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
addons:
coverity_scan:
project:
name: "Edvinas01/chat-rooms"
description: "Build submitted via Travis CI"
notification_email: "<EMAIL>"
build_command_prepend: "./gradlew clean"
build_command: "./gradlew build"
branch_pattern: coverity_scan
Do I have to specify some additional configuration so that my Coverity builds get published?
Got some time and created a virtual machine with java and the coverity analysis tool. After pulling my project and running the tool I noticed this in the logs:
[WARNING] No files were emitted. This may be due to a problem with your configuration
or because no files were actually compiled by your build command.
After fiddling quite a bit and looking at other projects, I found out that this was due to Gradle version. My project was using 3.0 so I downgraded to 2.14.1 and it finally seems to be working.
For what is worth, there is no issue with using Coverity with any Gradle version, as long as you make sure you are not using the daemon (just to be sure you may specify --no-daemon on the command line).
That said, there are a number of other easy to miss gotchas, resulting in not-quite-obvious error messages.
For useful background, see Caleb's answer here:
Can't get Coverity Scan to work (Java/Kotlin/Gradle 3.3 on Windows and Travis)
For working example, you may refer to this project:
https://github.com/ddimtirov/nuggets
Im trying to upload my project to circleci but from some reason it fails in a dropdown called "$ play test", I have no idea what is it, and I dont have tests in my project at all.
this is the section im talking about:
and im getting error there, this is the error:
I deleted "- sbt test" from my circle.yml so its not that, and I saw another folder of test in play so I thought maybe its that, but its empty, so I created a file in it and put nothing in it and still getting the same error...its driving me crazy ://///
please helpppppp
if you need this is my circle.yml:
machine:
services:
- docker
java:
version: oraclejdk8
environment:
SBT_VERSION: 0.13.9
SBT_OPTS: "-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M"
dependencies:
cache_directories:
- "~/.sbt"
- "~/.ivy2"
- "~/.m2"
- "~/docker"
pre:
- wget --output-document=$HOME/bin/sbt-launch.jar https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/"$SBT_VERSION"/sbt-launch.jar
- echo "java $SBT_OPTS -jar \`dirname \$0\`/sbt-launch.jar \"\$#\"" > $HOME/bin/sbt
- chmod u+x $HOME/bin/sbt
- sbt sbt-version
override:
- sbt clean update
post:
- find . -type f -regex ".*/target/test-reports/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/ \;
general:
artifacts:
- "target/universal/*.tgz"
deployment:
feature:
branch: /.*/
commands:
- docker login -e admin#something.com -u ${ART_USER} -p ${ART_KEY} docker-local.artifactoryonline.com
- sbt -DBUILD_NUMBER="${CIRCLE_BUILD_NUM}" docker:publish
CircleCI has a feature called Inference that looks at what language your project is in as well as directories found, file extensions, etc to guess what dependencies and test you have.
If you look to the right of where you saw "play test" you'll see that it says "inference" which means this test was a result of Interference and not circle.yml. Inference made an assumption you needed the Play test framework (https://www.playframework.com/) and thus ran a default check, play test (the $ is part of the prompt).
If this is not what you want, which looks to be the case, you'll need to override the test command to instead run whatever test you want. This would be something like:
test:
override:
- echo "This is my test"
- ./my-custom-command
More information: https://circleci.com/docs/configuration/#test
I'm trying to run a npm command inside of gradle task but I'm getting a strange error:
Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'npm'
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:65)
... 2 more
Caused by: java.io.IOException: Cannot run program "npm" (in directory "/Users/psilva/Documents/projects/registrolivre"): error=2, No such file or directory
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
... 4 more
Caused by: java.io.IOException: error=2, No such file or directory
And this is my task:
task npmInstall(type: Exec) {
commandLine "npm", "install"
}
Could someone help?
If you are on Windows try this:
task npmInstall(type: Exec) {
commandLine "npm.cmd", "install"
}
instead of this:
task npmInstall(type: Exec) {
commandLine "npm", "install"
}
This answer worked for me with a different npm-related task. The recommendation there is to use an executable and args rather than commandLine.
executable 'npm'
args ['install']
Depending on your directory structure, you may also need to add the workingDir property and set it to the directory where your package.json lives.
As an alternative, the Gradle Node Plugin is also really handy for managing the most common Node tasks in a Gradle build. I use this plugin as the basis for my Node tasks and then create other custom tasks as needed.
If you are using Windows OS, you have to use 'npm.cmd' instead of 'npm'. Better to detect whether OS is windows or not and build your npm command. Please see the code snippet below,
import org.apache.tools.ant.taskdefs.condition.Os
task npmInstall(type: Exec) {
String npm = 'npm';
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
npm = 'npm.cmd'
}
workingDir 'src/main/webapp'
commandLine npm, 'install'
}
On MX Linux I installed node in linux with nvm and none of the other answers worked for me.
The problem is
NVM patches environment variables on terminal startup only. If the IDE is launched from Terminal, it inherits Terminal environment...
Indeed it works starting IJ from bash terminal with ./idea.sh
In my case, nvm added the pathced env variables at the end of my ~./bashrc. The following steps worked for me;
Move the lines below from ~/.bashrc to ~./profile
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
$ sudo ln -s "$(which node)" /usr/local/bin/node
In IJ configure npm
Logout and login (session restart for step 1)
UPDATE:
In order to run nvm from bash. The following lines must be added to .bashrc
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
I used #ALDRIN P VINCENT answer to solve this issue. But if you need to pass command line arguments to npm script, you can do this:
Let's say following system properties are passed to gradle script
gradle test-Dsome1=dev -Dsome2=https://www.google.com
In your test script in build.gradle, you will do this:
task apifunctionaltest(type: Exec) {
String npm = 'npm';
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
npm = 'npm.cmd'
}
commandLine npm, 'run', 'test', '--', '--some1='+System.getProperty("some1"), '--some2='+System.getProperty("some2")
}
The main command starts with commandLine npm… This line equates to:
npm run test -- --some1=dev --some2=https://www.google.com
The test script in package.json also should have ‘npm install’ (it depends) command so node modules are installed before tests run. And if modules are already installed, node will not waste time and reinstall them. test script should be something like this:
"scripts": {
"test": "npm install && webpack"
}
And then you can pick those command line args thru process.argv[2] and process.argv[3].
If you have a simple script like mine, then some1 and some2 will be in the 2nd and 3rd position of an array, respectively.