Commit eda7a420 authored by Mathieu's avatar Mathieu
Browse files

[Site] Move external links in shared.link and add a test-urls option for the buildSite

parent 44b83e58
......@@ -27,6 +27,8 @@ import scalatags.Text.all._
import scala.annotation.tailrec
import spray.json._
import scalaj.http._
object Site extends App {
lazy val piwik =
......@@ -54,36 +56,33 @@ object Site extends App {
override def main(args: Array[String]): Unit = {
case class Parameters(
target: Option[File] = None,
test: Boolean = false,
ignored: List[String] = Nil
target: Option[File] = None,
test: Boolean = false,
testUrls: Boolean = false,
ignored: List[String] = Nil
)
@tailrec def parse(args: List[String], c: Parameters = Parameters()): Parameters = args match {
case "--target" :: tail parse(tail.tail, c.copy(target = tail.headOption.map(new File(_))))
case "--test" :: tail parse(tail, c.copy(test = true))
// case "--test" :: tail ⇒ parse(tail, c.copy(test = true))
//case "--market-test" :: tail ⇒ parse(tail, c.copy(marketTest = true))
//case "--resources" :: tail ⇒ parse(tail.tail, c.copy(resources = tail.headOption.map(new File(_))))
case s :: tail parse(tail, c.copy(ignored = s :: c.ignored))
case Nil c
case "--target" :: tail parse(tail.tail, c.copy(target = tail.headOption.map(new File(_))))
case "--test" :: tail parse(tail, c.copy(test = true))
case "--test-urls" :: tail parse(tail, c.copy(testUrls = true))
case s :: tail parse(tail, c.copy(ignored = s :: c.ignored))
case Nil c
}
val parameters = parse(args.toList.map(_.trim))
// Config.testScript = parameters.test
val dest = parameters.target match {
case Some(t) t
case None throw new RuntimeException("Missing argument --target")
}
// val marketEntries = generateMarket(parameters.resources.get, dest, dest / buildinfo.marketName, parameters.test && parameters.marketTest)
// DocumentationPages.marketEntries = marketEntries
if (parameters.test) {
Test.generate(dest)
}
else if (parameters.testUrls) {
Test.urls
}
else {
case class PageFrag(page: Page, frag: Frag)
......
package org.openmole.site
import java.io.File
import org.openmole.tool.file._
import scala.collection.mutable.ListBuffer
import scalaj.http._
object Test {
......@@ -16,7 +18,9 @@ object Test {
val tests =
try {
Pages.all.foreach { _.content }
Pages.all.foreach {
_.content
}
allTests.toVector.distinct
}
finally {
......@@ -30,12 +34,31 @@ object Test {
(t, i) tests.zipWithIndex
} {
def name: String = t.name.getOrElse(s"test${i}")
(target / s"${i}_$name.omt").content =
s"""${t.code}
|EmptyTask()
""".stripMargin
}
}
def urls = {
val tests = shared.links.map { l
println("Testing " + l)
val rep = Http(l).timeout(connTimeoutMs = 5000, readTimeoutMs = 60000).asString
(l, rep.code)
}
println("\nRESULT:")
val failed = tests.filter { _._2 >= 400 }
failed.isEmpty match {
case true println(s"The ${shared.links.size} external links are valid")
case false failed.foreach { l
println(s"${l._1} is invalid | ${l._2}")
}
}
}
}
case class Test(code: String, name: Option[String])
......@@ -46,7 +46,7 @@
Models: The Calibration Profile (CP) Algorithm » published in @i{Journal of Artificial Societies and Social Simulation}
(JASSS) , Vol 18, Issue 1, 2015.
@br
@a("[online version]" , href:="http://jasss.soc.surrey.ac.uk/18/1/12.html") @a("[bibteX]", href:= Resource.bibtex.profilemethodBib.file)
@a("[online version]" , href:= shared.link.paper.jassCP) @a("[bibteX]", href:= Resource.bibtex.profilemethodBib.file)
@li
Guillaume Chérel, Clémentine Cottineau and Romain Reuillon, « Beyond Corroboration: Strengthening Model
......
......@@ -11,7 +11,7 @@ you're running by typing @hl.highlight("java -version", "plain") in a console.
@div If you use the closed-source Oracle Java virtual machine (which is probably the case if you are working on Mac or
Windows), you have to install the Java Cryptography Extension (JCE) available at the bottom of this
@a("page", href := "http://www.oracle.com/technetwork/java/javase/downloads/index.html") in order for OpenMOLE to be
@aa("page", href := shared.link.jce) in order for OpenMOLE to be
fully functional.
@div JCE is an archive containing a bunch of files that you should replace in the @i{jre/lib/security}
......@@ -24,7 +24,7 @@ containing @i{.../bin/java}).
@question("Where can I find the old versions of OpenMOLE?")
@div Old versions of OpenMOLE software and documentation are available @a("here", href := "http://www.openmole.org/all/"). Due to a data loss in 2016, the versions from OpenMOLE 6 are available only.
@div Old versions of OpenMOLE software and documentation are available @aa("here", href := shared.link.allOpenMOLE). Due to a data loss in 2016, the versions from OpenMOLE 6 are available only.
@question("OpenMOLE cannot connect to my environment using SSH")
......@@ -141,9 +141,9 @@ downloaded CARE before the release of OpenMOLE 6.0, you might be faced with this
@div @hl.highlight("care info: pid 24238: terminated with signal 11", "plain").
@div The easiest option to solve this problem is to download a fixed version from @a("GitHub", href := "https://github.com/proot-me/proot-static-build/releases/download/v5.1.1/care_2.2.2_x86_64_rc1--no-seccomp").
@div The easiest option to solve this problem is to download a fixed version from @aa("GitHub", href := shared.link.care).
@div This binary only works for 64 bits machines, which might not be the case of your workstation. Older versions of CARE are still available for different computer architecture from @a("GitHub", href := "https://github.com/proot-me/proot-static-build/tree/master/static"). These versions require
@div This binary only works for 64 bits machines, which might not be the case of your workstation. Older versions of CARE are still available for different computer architecture from @aa("GitHub", href := shared.link.prootStatic). These versions require
the @hl.highlight("PROOT_NO_SECCOMP", "plain") environment variable to be set to 1 when running CARE. The packaging command line becomes:
@div @hl.highlight("PROOT_NO_SECCOMP=1 care -o foo.tgz.bin -r ~ my_app -input 42", "plain")
......@@ -156,7 +156,7 @@ the @hl.highlight("PROOT_NO_SECCOMP", "plain") environment variable to be set to
@div There is nothing to change in your OpenMOLE scripts, the good folks at OpenMOLE have everything under control ;)
@div For more information about this specific problem, you can join this @a("discussion", href := "https://github.com/proot-me/PRoot/issues/106").
@div For more information about this specific problem, you can join this @aa("discussion", href := shared.link.prootIssue106).
@question("I get an error relate to file on linux and there is 'too many open files' written somewhere in the error")
@div On linux server the number of file a use can open is generally limited to 1024. OpenMOLE increase it to 4096 when on launch, but it doesn't seem to work on your system, you might want to understand why. To check the current of you system limit execute @i{ulimit -a} in a terminal:
......@@ -199,7 +199,7 @@ proot terminated with signal 6
care -o myapp.tgz.bin python3 myapp.py param1 param2
""", "plain")
@div The workaround uses @a("xvfb", href := "https://www.x.org/releases/X11R7.7/doc/man/man1/Xvfb.1.xhtml"), a virtual framebuffer X server. The only thing you have to do is to run you command through xvfb. In our example, that would be:
@div The workaround uses @aa("xvfb", href := shared.link.xvfb), a virtual framebuffer X server. The only thing you have to do is to run you command through xvfb. In our example, that would be:
@hl.highlight("""
care -o myapp.tgz.bin xvfb-run python3 myapp.py param1 param2
......@@ -218,7 +218,7 @@ care -o myapp.tgz.bin xvfb-run python3 myapp.py param1 param2
@div When you find yourself in such a use case, you might want to try the @hl.openmoleNoTest{Path} optimisation for your scripts. By replacing the @hl.openmoleNoTest{Val[File]} variables by @hl.openmoleNoTest{Val[Path]} in your scripts, OpenMOLE will store the file's @b{location} and not its @b{content} as it would when using @hl.openmoleNoTest{Val[File]}.
@div This optimisation is only available for @a("cluster", href := DocumentationPages.cluster.file) and @b{not} for the @a("EGI grid", href := DocumentationPages.egi.file).
@div This optimisation is only available for @aa("cluster", href := DocumentationPages.cluster.file) and @b{not} for the @aa("EGI grid", href := DocumentationPages.egi.file).
@div You can find an example of using @hl.openmoleNoTest{Path} variables in the dataflow in the @a("data processing section", href := DocumentationPages.dataProcessing.file), and learn more about the OpenMOLE dataflow in the @a("dedicated section", href := DocumentationPages.dataflow.file).
......@@ -228,5 +228,5 @@ care -o myapp.tgz.bin xvfb-run python3 myapp.py param1 param2
@div If you could not resolve your problems, feel free to post your problem on the @a("mailing-list",
href := shared.link.mailingList).
@div If you think your problem is induced by a bug in OpenMOLE, please report the issue exhaustively on our @a(
@div If you think your problem is induced by a bug in OpenMOLE, please report the issue exhaustively on our @aa(
"GitHub page", href := shared.link.issue).
......@@ -6,7 +6,7 @@ These trainings are given around every 2 months. In 3 hours, you will learn how
the application, what are the main concepts and how to build your first experiments. They take place
at the ISC-PIF lab, Paris.
@p
@linkButton("Program and registration", shared.link.shortTraining, classIs(btn ++ btn_danger))
@linkButton("Program and registration", shared.link.shortTrainings, classIs(btn ++ btn_danger))
@h1{Long trainings}
......@@ -16,4 +16,4 @@ optimization methods are explained and experienced in detail.
@p
@linkButton("Program and registration", shared.link.longTraining, classIs(btn ++ btn_danger))
\ No newline at end of file
@linkButton("Program and registration", shared.link.longTrainings, classIs(btn ++ btn_danger))
\ No newline at end of file
......@@ -84,7 +84,7 @@ It also explains the various versions of OpenMOLE you may want to use/deploy, fr
@sect{@shared.howToContributeMenu.compileDocker}
An easy way to get an OpenMOLE compilation environment up and running is to use docker. Once docker is installed on you machine you can do:
@br @hl.highlight("""
git clone https://github.com/openmole/docker-build.git
git clone shared.link.openMOLEDockerBuild
cd docker-build
./run -v /a/local/path/on/your/system
# You should be in the docker container now, execute
......
......@@ -71,5 +71,5 @@ A key feature in OpenMOLE is the possibility to delegate the workload to a remot
@aa("Slurm", href := DocumentationPages.cluster.anchor(shared.clusterMenu.slurm)),
@aa("Condor", href := DocumentationPages.cluster.anchor(shared.clusterMenu.condor)),
or @aa("OAR", href := DocumentationPages.cluster.anchor(shared.clusterMenu.oar)).
You can also use @aa("EGI", href := DocumentationPages.egi.file) to execute tasks on the @a("EGI grid", href := "http://www.egi.eu/").
You can also use @aa("EGI", href := DocumentationPages.egi.file) to execute tasks on the @aa("EGI grid", href := shared.link.egi).
......@@ -24,5 +24,5 @@ the OpenMOLE way. You can discover them through the Market place or tutorials.
@break
Feel free to suggest new tutorial on topics you'd like us to describe more thoroughly. You can even write your own
and share it with the OpenMOLE community on the @a("wiki", href := "https://github.com/openmole/openmole/wiki")! We'll
and share it with the OpenMOLE community on the @a("wiki", href := shared.link.openMOLEWiki)! We'll
make sure to integrate it in the next release.
......@@ -28,7 +28,7 @@ Model inputs come in many shapes; this is why OpenMOLE features some file explor
""")
@br
The @hl.openmoleNoTest{filter} modifier filters the initial file sampling according to a predicate.
You can filter using any function taking a @hl.openmoleNoTest{File} and producing a @hl.openmoleNoTest{Boolean} (see the corresponding @a("javadoc", href := "https://docs.oracle.com/javase/8/docs/api/java/io/File.html") or create your own). Some predicate functions available out of the box are @hl.highlight("startsWith(), contains(), endsWith() ", "plain").
You can filter using any function taking a @hl.openmoleNoTest{File} and producing a @hl.openmoleNoTest{Boolean} (see the corresponding @a("javadoc", href := shared.link.javaFile) or create your own). Some predicate functions available out of the box are @hl.highlight("startsWith(), contains(), endsWith() ", "plain").
@br
@hl.openmole("""
val f = Val[File]
......
......@@ -178,7 +178,7 @@ If you want to use design of experiments of your own you may also want to provid
optionally filtered with any @hl.code("String => Boolean") functions such as @hl.highlight("contains(), startswith(), endswith()", "plain")
(see the @a("Java Class String Documentation", href:="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html")
(see the @a("Java Class String Documentation", href:= shared.link.javaString)
for more details)
......
......@@ -49,7 +49,7 @@ PSE handles stochasticity in the sense that the selected pattern are estimated b
The PSE method searches for diverse output values. As with all
evolutionary algorithms, PSE generates new individuals through
a combination of genetic inheritance from parent individuals
and mutation. PSE (inspired by @a("novelty search", href := "http://eplex.cs.ucf.edu/noveltysearch/userspage/")) selects for
and mutation. PSE (inspired by @a("novelty search", href := shared.link.noveltySearch)) selects for
the parents whose output values are rare compared to the rest of
the population and to the previous generations. In order to evaluate
the rarity of a the output values, PSE discretises the output space,
......@@ -119,5 +119,5 @@ of inputs and outputs are illimited.
Guillaume Chérel, Clémentine Cottineau and Romain Reuillon, « Beyond Corroboration: Strengthening Model
Validation by Looking for Unexpected Patterns» published in @i{PLOS ONE} 10(9), 2015.
@br
@a("[online version]" , href:="http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0138212") @a("[bibteX]", href:= Resource.bibtex.PSEmethodBib.file)
@a("[online version]" , href:=shared.link.beyondCorroboration) @a("[bibteX]", href:= Resource.bibtex.PSEmethodBib.file)
......@@ -135,4 +135,4 @@ Romain Reuillon, Clara Schmitt, Ricardo De Aldama, and Jean-Baptiste Mouret, «A
Models: The Calibration Profile (CP) Algorithm » published in @i{Journal of Artificial Societies and Social Simulation}
(JASSS) , Vol 18, Issue 1, 2015.
@br
@a("[online version]" , href:="http://jasss.soc.surrey.ac.uk/18/1/12.html") @a("[bibteX]", href:= Resource.bibtex.profilemethodBib.file)
@a("[online version]" , href:= shared.link.paper.jassCP) @a("[bibteX]", href:= Resource.bibtex.profilemethodBib.file)
......@@ -50,7 +50,7 @@ common NetLogo example. It studies the percolation of a fire in a forest dependi
any formal conclusion).
@p You can get the NetLogo implementation of the model
@a("here", href := "http://www.openmole.org/files/segregation.nlogo").
@a("here", href := shared.link.netlogoSegregation).
@sect{@shared.netlogoMenu.doe}
We first need to define 2 OpenMOLE variables in order to repeat our experience 10 times for every step of the
......
......@@ -96,9 +96,9 @@
@p The combination of the three objectives indicates the quality of the parameters used to run the simulation.
This situation is a
@a("multi-objective optimisation", href := "http://en.wikipedia.org/wiki/Multiobjective_optimization") problem. In
@a("multi-objective optimisation", href := shared.link.multiobjectiveOptimization) problem. In
case there is a compromise between these 3 objectives, we will obtain a
@a("Pareto frontier", href := "http://en.wikipedia.org/wiki/Pareto_efficiency") at the end of the optimisation
@a("Pareto frontier", href := shared.link.paretoEfficency) at the end of the optimisation
process.
......
......@@ -64,6 +64,7 @@ package object shared {
lazy val pythonExample = "Another example with Python"
lazy val advancedOptions = "Advanced options"
}
object nativePackagingMenu {
lazy val introCARE = "Packaging with CARE"
lazy val advancedOptions = "Advanced Options"
......@@ -165,14 +166,15 @@ package object shared {
}
object link {
lazy val demo = "http://demo.openmole.org"
lazy val twitter = "https://twitter.com/OpenMOLE"
lazy val blog = "https://blog.openmole.org"
lazy val chat = "https://chat.iscpif.fr/channel/openmole"
lazy val simpluDemo = "https://simplu.openmole.org"
lazy val mailingList = "http://ask.openmole.org"
lazy val shortTraining = "https://iscpif.fr/events/formationsjedi/"
lazy val longTraining = "http://cnrsformation.cnrs.fr"
lazy val shortTrainings = "https://iscpif.fr/events/formationsjedi/"
lazy val longTrainings = "http://cnrsformation.cnrs.fr"
lazy val egi = "http://www.egi.eu/"
lazy val batchProcessing = "https://en.wikipedia.org/wiki/Batch_processing"
lazy val batchSystem = "http://en.wikipedia.org/wiki/Portable_Batch_System"
......@@ -203,6 +205,24 @@ package object shared {
lazy val urbanDynamicsBib = "https://hal.archives-ouvertes.fr/hal-01583528v1/bibtex"
lazy val sobol = "https://en.wikipedia.org/wiki/Sobol_sequence"
lazy val lhs = "https://en.wikipedia.org/wiki/Latin_hypercube_sampling"
lazy val jce = "http://www.oracle.com/technetwork/java/javase/downloads/index.html"
lazy val allOpenMOLE = "http://www.openmole.org/all/"
lazy val care = "https://github.com/proot-me/proot-static-build/releases/download/v5.1.1/care_2.2.2_x86_64_rc2--no-seccomp"
lazy val prootIssue106 = "https://github.com/proot-me/PRoot/issues/106"
lazy val xvfb = "https://www.x.org/releases/X11R7.7/doc/man/man1/Xvfb.1.xhtml"
lazy val prootStatic = "https://github.com/proot-me/proot-static-build/tree/master/static"
lazy val multiobjectiveOptimization = "http://en.wikipedia.org/wiki/Multiobjective_optimization"
lazy val paretoEfficency = "http://en.wikipedia.org/wiki/Pareto_efficiency"
lazy val openMOLEWiki = "https://github.com/openmole/openmole/wiki"
lazy val noveltySearch = "http://eplex.cs.ucf.edu/noveltysearch/userspage/"
lazy val beyondCorroboration = "http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0138212"
lazy val javaString = "https://docs.oracle.com/javase/7/docs/api/java/lang/String.html"
lazy val javaFile = "https://docs.oracle.com/javase/8/docs/api/java/io/File.html"
lazy val netlogoSegregation = "http://www.openmole.org/files/segregation.nlogo"
object paper {
lazy val jassCP = "http://jasss.soc.surrey.ac.uk/18/1/12.html"
}
object partner {
lazy val iscpif = "http://iscpif.fr"
......@@ -217,12 +237,13 @@ package object shared {
lazy val openmole = "https://github.com/openmole/openmole"
lazy val market = "https://github.com/openmole/openmole-market"
lazy val gridscale = "https://github.com/openmole/gridscale"
lazy val scaladget = "https://github.com/openmole/scaladaget"
lazy val scaladget = "https://github.com/openmole/scaladget"
lazy val scalawui = "https://github.com/openmole/scalaWUI"
lazy val mgo = "https://github.com/openmole/mgo"
lazy val simplu = "https://github.com/IGNF/simplu3D"
lazy val myOpenmolePlugin = "https://github.com/openmole/myopenmoleplugin"
lazy val gamaPlugin = "https://github.com/openmole/gama-plugin"
lazy val openMOLEDockerBuild = "https://github.com/openmole/docker-build.git"
}
}
......@@ -232,4 +253,78 @@ package object shared {
raw(content).applyTo(builder)
div(textAlign := "center")(builder.children.head)
}
import link._
val links = Seq(
partner.iscpif,
partner.parisgeo,
partner.biomedia,
partner.idf,
partner.paris,
partner.ign,
paper.jassCP,
repo.openmole,
repo.market,
repo.gridscale,
repo.scaladget,
repo.scalawui,
repo.mgo,
repo.simplu,
repo.myOpenmolePlugin,
repo.gamaPlugin,
repo.openMOLEDockerBuild,
demo,
twitter,
blog,
chat,
simpluDemo,
mailingList,
shortTrainings,
longTrainings,
egi,
batchProcessing,
batchSystem,
grieEngine,
slurm,
condor,
oar,
ssh,
geodivercity,
ercSpringer,
git,
gitlfs,
sbt,
scala,
scalaBook,
scalaDoc,
intelliJ,
scalatex,
netlogoAnts,
branchingModel,
issue,
pullRequests,
next,
CAREsite,
CAREmailing,
ggplot2,
urbanDynamics,
urbanDynamicsBib,
sobol,
lhs,
jce,
allOpenMOLE,
care,
prootIssue106,
xvfb,
prootStatic,
multiobjectiveOptimization,
paretoEfficency,
openMOLEWiki,
noveltySearch,
beyondCorroboration,
javaString,
javaFile,
netlogoSegregation
)
}
......@@ -803,7 +803,8 @@ lazy val site = crossProject.in(binDir / "org.openmole.site") settings (defaultS
libraryDependencies += Libraries.json4s,
libraryDependencies += Libraries.spray,
libraryDependencies += Libraries.txtmark,
libraryDependencies += Libraries.scalaTags
libraryDependencies += Libraries.scalaTags,
libraryDependencies += Libraries.scalajHttp,
) jsSettings(
Libraries.rxJS,
Libraries.scaladgetJS,
......
......@@ -54,7 +54,7 @@ object Libraries {
lazy val jasypt = "org.openmole.library" %% "org-jasypt-encryption" % "1.9.2"
lazy val opencsv = "org.openmole.library" %% "au-com-bytecode-opencsv" % "2.3"
lazy val arm = "org.openmole.library" %% "com-jsuereth-scala-arm" % "2.0"
lazy val scalajHttp = "org.openmole.library" %% "org-scalaj-scalaj-http" % "0.3.15"
lazy val scalajHttp = "org.openmole.library" %% "org-scalaj-scalaj-http" % "2.3.0"
lazy val scopt = "org.openmole.library" %% "com-github-scopt" % "3.5.0"
lazy val scalabc = "org.openmole.library" %% "fr-iscpif-scalabc" % "0.4"
lazy val scalatexSite = "org.openmole.library" %% "com-lihaoyi-scalatex-site" % "0.3.11"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment