Skip to content

Instantly share code, notes, and snippets.

View Magisus's full-sized avatar

Maggie Dreyer Magisus

  • Puppet, Inc.
  • Portland, OR
View GitHub Profile
[2022-07-01T16:14:11.855Z] === FAIL: internal/jobs (0.00s)
[2022-07-01T16:14:11.855Z] time="2022-07-01T16:03:03Z" level=info msg="No config found in KV - proceeding" func=github.com/puppetlabs/data-ingestion/internal/config/manager.ConfigManager.Load file="/home/jenkins/agent/workspace/pipeline_hdp_core_PR-617/internal/config/manager/lib.go:150"
[2022-07-01T16:14:11.855Z] time="2022-07-01T16:07:49Z" level=info msg="Get \"http://127.0.0.1:49153/\": read tcp 127.0.0.1:46582->127.0.0.1:49153: read: connection reset by peer" func="github.com/puppetlabs/data-ingestion/internal/test_utils/elasticsearch.(*ElasticSearchInstance).Open" file="/home/jenkins/agent/workspace/pipeline_hdp_core_PR-617/internal/test_utils/elasticsearch/lib.go:91"
[2022-07-01T16:14:11.856Z] time="2022-07-01T16:07:50Z" level=info msg="Get \"http://127.0.0.1:49153/\": read tcp 127.0.0.1:46598->127.0.0.1:49153: read: connection reset by peer" func="github.com/puppetlabs/data-ingestion/internal/test_utils/elasticsearch.(*ElasticSearchInstance
@Magisus
Magisus / build_and_install.txt
Last active July 28, 2021 18:27
Building and installing FOSS puppetserver
Before you begin, you'll need:
* leiningen (https://leiningen.org/)
* Java 8
* A clone of puppetserver with your changes made (they don't need to be committed for this)
1. In the puppetserver repo, build a new package with ezbake. You can create a Jenkins token by going to your profile on https://jenkins-platform.delivery.puppetlabs.net/ and generating one, then copying it into this command, along with your LDAP username.
=> lein clean && lein install && EZBAKE_ALLOW_UNREPRODUCIBLE_BUILDS=true EZBAKE_NODEPLOY=true JENKINS_USER_AUTH="<jenkins username>:<platform jenkins user token>" lein with-profile ezbake,provided ezbake build
2. The end of the output will link to a specific folder in http://builds.delivery.puppetlabs.net/puppetserver/. Your artifacts will appear here when Jenkins has finished building them.
@Magisus
Magisus / orch_tests.txt
Created July 22, 2021 21:49
Running orchestrator tests
1. Install/update Docker Desktop
2. Clone https://github.com/steveax/docker-pglogical and follow its readme instructions
3. Run `./dev-setup` in the orchestrator repo, which will create all the relevant DB fixtures
4. Run `lein test`
Nick Lewis does:
`docker run --rm --name=orchestrator_test --env POSTGRES_PASSWORD=docker --detach \
--publish 5432:5432 postgres -c max-connections=200`
and
`PGHOST=localhost PGPASSWORD=docker ./dev-setup`
@Magisus
Magisus / stack1.txt
Last active February 23, 2021 16:40
Puppet Multithreaded deadlock
- waiting to lock <0x000000009549a9f8> (a org.jruby.gen.RubyObject6)
at opt.puppetlabs.puppet.lib.ruby.vendor_ruby.puppet.pops.functions.function.invokeOther14:load(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/functions/function.rb:116)
at opt.puppetlabs.puppet.lib.ruby.vendor_ruby.puppet.pops.functions.function.RUBY$method$internal_call_function$0(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/functions/function.rb:116)
at opt.puppetlabs.puppet.lib.ruby.vendor_ruby.puppet.pops.functions.function.invokeOther1:internal_call_function(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/functions/function.rb:74)
at opt.puppetlabs.puppet.lib.ruby.vendor_ruby.puppet.pops.functions.function.RUBY$method$call_function$0(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/functions/function.rb:74)
at opt.puppetlabs.puppet.lib.ruby.vendor_ruby.puppet.pops.functions.dispatch.invokeOther6:send(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/functions/dispatch.rb:60)
at opt.puppet
@Magisus
Magisus / gist:d209c31ccf8cf33ac11881d9bd4f035e
Last active September 24, 2020 17:33
Building a pe-puppetserver uberjar with a dev dependency
On branches for Marshall and beyond*:
1. Make changes to dependent project (no commit necessary)
2. Run `lein clean && lein install` in that project dir, will put a SNAPSHOT version in your local maven repo
3. Update the entry for the dep in the `project.clj` file of pe-puppet-server-extenions to point to that installed SNAPSHOT version
4. Run `lein clean && lein uberjar` in pe-puppet-server-extensions. This creates a new `puppet-server-release.jar` in `target`
5. Copy the jar to your PE box:
`scp target/puppet-server-release.jar root@MY-VM.delivery.puppetlabs.net:/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar`
6. On that box, restart pe-puppetserver
https://github.com/jruby/jruby/pull/5584/commits/bb90d3b7644316f8ae6b92e02defdf3838854fb5
1. Make changes to JRuby source
2. Update VERSION file to SNAPSHOT version
3. Run `./mvnw` to build jars and install them to local maven repo
4. Update jruby version in `jruby-deps` to new SNAPSHOT.
5. Update `jruby-deps` version in `jruby-utils`.
6. Update `jruby-utils` version in puppetserver.
7. Run repl.
@Magisus
Magisus / enable_code_manager.txt
Last active March 21, 2022 22:48
Enable Code Manager
Steps to enable Code Manager on a VMPooler node
1. Install PE
2. Generate an SSH key to use with Github and add it to your Github
3. Control repo: https://github.com/Magisus/control-repo -> git@github.com:Magisus/control-repo.git
4. Set params of puppet_enterprise::profile::master:
- code_manager_auto_configure: true
- r10k_remote: git@github.com:Magisus/control-repo.git
- r10k_private_key: point at key created above, e.g. "/etc/puppetlabs/puppetserver/ssh/id_rsa-control"
5. Run puppet agent
@Magisus
Magisus / stacktrace.txt
Last active November 6, 2019 21:03
Hung Catalog compile thread
qtp1022017974-89798
at com.kenai.jffi.Foreign.invokeL3(JJJJJ)J (Native Method)
at com.kenai.jffi.Invoker.invokeL3(Lcom/kenai/jffi/CallContext;JJJJ)J (Invoker.java:407)
at jnr.enxio.channels.Native$LibC$jnr$ffi$1.poll(Ljava/nio/ByteBuffer;II)I (Unknown Source)
at jnr.enxio.channels.PollSelector.poll(J)I (PollSelector.java:226)
at jnr.enxio.channels.PollSelector.select()I (PollSelector.java:205)
at org.jruby.RubyThread.select(Ljava/nio/channels/Channel;Lorg/jruby/util/io/OpenFile;IJ)Z (RubyThread.java:1797)
at org.jruby.RubyThread.select(Ljava/nio/channels/Channel;Lorg/jruby/util/io/OpenFile;I)Z (RubyThread.java:1718)
at org.jruby.util.io.OpenFile.waitReadable(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/util/io/ChannelFD;)Z (OpenFile.java:1414)
at org.jruby.util.io.OpenFile.ioBufread(Lorg/jruby/runtime/ThreadContext;[BII)I (OpenFile.java:1724)
require 'puppet/server/master'
require 'securerandom'
require 'json'
require 'uri'
class PuppetServerHelper
# alternatively: load 'spec/lib/puppet_spec/handler'; profiler = PuppetSpec::HandlerProfiler.new ????
NullProfiler = Struct.new("Profiler") do
def start(*args); end
require 'openssl'
# To use this script to generate a CRL, supply the path to the cert
# PEM file, followed by the key PEM file, followed by the output path
# for the CRL.
#
# Example:
# ruby generate_crl.rb ca_crt.pem ca_key.pem new_crl.pem
#
# The resulting CRL should be concatenated into a file with the other