I'm using Puppet to install a specific kernel on an agent. The problem is, I can't quite seem to give it a version. I have the following:
class kernel::install_kernel_version {
# Make sure the 'kernel' package is installed in build agent
case $::osfamily {
'RedHat': {
require epel
package {'kernel':
ensure => '2.6.32-431.29.2.e16.x86_64'}
}
default: {
fail("Module is not compatible with ${::operatingsystem}")
}
}
}
Every time I to run it, there's no effect. Presumably because it doesn't know the kernel version exists.
Related
I have a very long list of coq projects I want to automatically install with opam pin/install. I'd like to install them with opam because I am using this python tool (PyCoq) that uses opam pin/install. How can I automatically create a COQ_PROJ.opam / *.opam file given a coq project that I can install with make?
For example, a format of a coq project/package (proj/pkg) that works for me is this: https://github.com/IBM/pycoq/tree/main/pycoq/test/lf
An idea is that in pip one can easily create a pip requirements file from a python project that is already installed (Automatically create requirements.txt). Thus, one possible solution could be:
install the coq project with make (or it's instructions)
run the equivalent of pip freeze > requirements.txt but for coq.
How does one do that?
sample list of coq projs:
[
{
"project_name": "constructive-geometry",
"train_files": [
"problems.v",
"affinity.v",
"basis.v",
"orthogonality.v",
"part1.v",
"part3.v",
"part2.v"
],
"test_files": [],
"switch": "coq-8.10"
},
{
"project_name": "higman-s",
"train_files": [
"inductive_wqo.v",
"higman_aux.v",
"higman.v",
"list_embeding.v",
"tree.v"
],
"test_files": [],
"switch": "coq-8.10"
},
{
"project_name": "int-map",
"train_files": [
"Mapcanon.v",
"Mapc.v",
"Mapaxioms.v",
"Map.v",
"Adalloc.v",
"Fset.v",
"Mapsubset.v",
"Mapfold.v",
"Maplists.v",
"Lsort.v",
"Mapcard.v",
"Allmaps.v",
"FMapIntMap.v",
"Mapiter.v"
],
...
I do know about opam switch export/import/create but I doubt it works due to this reason:
I think opam switch export assumes that everything I've installed so far was already available in your opam switch already: Save the current switch state to a file.. Thus I think it assumes that you've installed everything so far with opam which is not always true for every coq project afaik and if it were I wouldn't have this issue in the first place -- since I would have used opam pin/install in the first place to install the coq proj/pkg. I think some coq projects/packages use a coq_makefile -f _CoqProject -o CoqMakefile followed by a make command (ref: https://coq.inria.fr/refman/practical-tools/utilities.html#building-a-coq-project, https://stackoverflow.com/questions/72586352/what-is-the-best-practice-for-installing-external-dependencies-in-a-coq-project). Those that use make are my target. I know make can run arbitrary code but I am hoping there is a standard way to install things in coq that will help me connect it with opam...or python...
though I could try running make and then opam switch export though I don't know how opam would know how make compiled and got dependencies if make uses only coqc or something else that doesn't install it to opam...any ideas?
Perhaps useful self contained coq proj/pkg: https://github.com/brando90/pycoq/tree/main/debug_proj though it uses no external dependencies for now :(, help extending it for even the simplest depedency for the sake of example is welcomed!
references:
proverbot's discussion: https://github.com/UCSD-PL/proverbot9001/issues/27
question/discussion in the original coq-gym repo: https://github.com/princeton-vl/CoqGym/discussions/77
coq projects: https://github.com/UCSD-PL/proverbot9001/tree/master/coq-projects
useful reference for install coq projs: What is the best practice for installing external dependencies in a Coq project?
gitissue in my PyCoq fork: https://github.com/brando90/pycoq/issues/4
https://coq.zulipchat.com/#narrow/stream/252087-Machine-learning-and-automation/topic/Installation.20of.20a.20diverse.20set.20of.20Coq.20package.20for.20ML/near/294876190
With tools like npm we can install a specific version
npm install foo#1.2.0
How do you install a specific version using spago install?
Firstly, that's not what spago install does. Instead of "adding a package to your project", spago install downloads all packages that are currently referenced in your spago.dhall file.
Secondly, the idea with Spago is that you don't choose a specific package version. Instead what you choose is a "snapshot", which is a collection of certain versions of all available packages that are guaranteed to compile and work together. This is a measure intended to prevent version conflicts and versioning hell (and this is similar to how Haskell stack works)
The snapshot is defined in your packages.dhall file, and then you specify the specific packages that you want to use in spago.dhall. The version for each package comes from the snapshot.
But if you really need to install a very specific version of a package, and you really know what you're doing, then you can modify the snapshot itself, which is described in packages.dhall.
By default your packages.dhall file might look something like this:
let upstream =
https://raw.githubusercontent.com/purescript/package-sets/psc-0.13.5-20200103/src/packages.dhall sha256:0a6051982fb4eedb72fbe5ca4282259719b7b9b525a4dda60367f98079132f30
let additions = {=}
let overrides = {=}
in upstream // additions // overrides
This is the default template that you get after running spago new.
In order to override the version for a specific package, add it to the overrides map like this:
let overrides =
{ foo =
upstream.foo // { version = "v1.2.0" }
}
And then run spago install. Spago should pull in version 1.2.0 of the foo package for you.
This question is a follow-up to:
Running Vuetify on Vert.x (w/ES4X)
I would like to be able to run ES4X via Eclipse (instead of NPM). I'm not exactly sure if it's possible or how to wire it in.
Let's say I have the following build.gradle.file
plugins {
id 'java'
id 'application'
id 'com.johnrengleman.shadow' version "5.0.0"
}
sourceCompatibility='1.8'
mainClassName='io.vertx.core.Launcher'
repositories {
mavenCentral()
}
dependencies {
implementation 'io.vertx:vertx-core:3.7.1'
implementation 'io.vertx:vertx-web:3.7.1'
implementation 'io.vertx:vertx-lang-js:3.7.1'
// implementation 'io.reactiverse:es4x:0.8.0'
// implementation 'io.reactiverse:es4x-pm:0.8.0'
}
processResources {
from '/src/main/js'
}
shadowJar {
classifier = 'fat'
manifest {
attributes 'Main-Verticle' : 'index.js'
}
mergeServiceFiles {
include 'META-INF/services/io.vertx.core.spi.VerticleFactory'
}
}
and my src/main/js/index.js looks like the one from the other referenced post:
import { Router, StaticHandler } from '#vertx/web';
const app = Router.router(vertx);
app.get().handler(StaticHandler.create("dist"));
vertx.createHttpServer().requestHandler(app).listen(8080);
If I create an executable jar via shadowJar, I get javax.script.ScriptExceptions due to Nashorn choking on the index.js contents (as expected).
If I uncomment the es4x implementation in the gradle build, I get ClassNotFound exceptions for org.graalvm.polyglot.io.FileSystem
So how would I correctly modify this app to take advantage of ES4X? I guess the equivalent of what the 'es4x init' would do?
Say that you have your es4x application and a package.json, when you execute:
npm install
You will get inside node_modules a few extra folders:
.bin
.lib
In the .bin directory there is a es4x-launcher.jar file you can use to start your application from Eclipse. It will refer to the dependencies which are unpacked to the .lib dir. In order to make things work fine the same JVM you have when running the npm install command should be used in eclipse. Otherwise you might end up missing dependencies. This is the case when running graalvm which will not require graaljs dependencies or when running on jdk8 which will not require jvmci dependencies.
I setup a class in my site.pp
class packages {
Package { ensure => 'installed' }
package { 'python-devel': }
package { 'blas-devel': }
package { 'lapack-devel': }
}
but nothing seems to be happening?
when i run
pip install scipy
I still get that Python.h cannot be compiled so I take it python devel didn't install
You have defined class 'packages', but you do not show that class being assigned to any node. That's like writing a function but never calling it.
You need to declare that class to assign it to specific nodes or to all nodes (depending on the context of the declaration). There are a few different forms for that, but about the simplest thing you could do would be to add ...
include 'packages'
... on the line after the closing brace of your class definition.
The result will still be in rather poor form, as classes should be defined in modules, not in site.pp, and declarations rarely should appear at top scope (outside any node block, class definition, or type definition), but it will instruct Puppet that when it runs, it should ensure that the packages you specify are installed.
Actually, the way you wrote the code for the modules doesn't look right. I would try something more like the following
class 'my-python' {
package {'python-devel':
ensure => installed,
}
package {'lapack-devel':
ensure => installed,
}
package {'python-devel':
ensure => installed,
}
}
you define each of the packages within the class as seperate package resources. Then you need to 'include mypython' in your site.pp for the node you want to install them on. Run puppet and you should be good.
I'm using puppet for managing configuration a bunch of CentOS 5 servers. I would like to add a some package exclusions to the CentOS base yum repo configuration. Is there a way to do this with puppet?
I am going to use the remi repo version of some packages and want to exclude the base versions from yum. To enable remi I have a yumrepo resource defined.
You can use exclude parameter in yumrepo
yumrepo { 'centos_base' :
baseurl => "...",
enabled => 1,
priority => 1,
exclude => "package-name",
}
You can also require a particular yumrepo when installing a package.
package { "package-name" :
ensure => installed,
require => Yumrepo["RemiRepo"],
}