Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimum Updates for percli to run peregrine on Sling 12 based instance #18

Open
cmrockwell opened this issue Aug 31, 2020 · 7 comments
Open
Assignees

Comments

@cmrockwell
Copy link

Corresponding to a Sling 12 based launcher, percli needs a few changes.

  1. --sling or -s is the sling version. There needs to be an option for 12
    https://github.com/headwirecom/percli/blob/master/bin/percli-server-install#L42

  2. Sling 12 needs a launcher (org.apache.sling.feature.launcher.jar) and feature aggregate (feature-oak_tar.json). I presume those need to be hosted on headwire's vagrant. and referenced in
    https://github.com/cmrockwell/peregrine-cms/blob/upgrade/sling12-PM-Java11/docker/scripts/start.sh

  3. Run modes and TCP port previously set in sling/sling.properties need to be set using launcher framework properties -D properties. For example:
    java -jar org.apache.sling.feature.launcher.jar -f feature-oak_tar_fds.json -D sling.runmodes=author,notshared,oak_tar,fds -p sling

@reusr1
Copy link
Contributor

reusr1 commented Aug 31, 2020

@cmrockwell I am wondering if we want to push 2) to github instead - it could make sense to have these files on https://github.com/peregrine-cms with a repo to build and publish the latest version to decouple this headwire dependency

@cmrockwell
Copy link
Author

@reusr1 That sounds like a great idea

@cmrockwell
Copy link
Author

Another thing to think about is how start and stop scripts will work without support for sling.properties and without a Starter jar that takes 'start', 'stop' , 'status', or 'threads'

@reusr1
Copy link
Contributor

reusr1 commented Aug 31, 2020

we may want to consider the sling kickstarter for peregrine instead of launching a feature model directly. After all that's what it was written for

https://sling.apache.org/documentation/feature-model/howtos/kickstart.html

@cmrockwell
Copy link
Author

Kickstart is either not working or I'm doing it wrong. I'm testing it with the script below, and have some issues:

  • Install Run Mode Options are not taking effect. In the short run, we need runmodes until they can be refactored into feature files.
  • Sling Home is not properly defined. Using either -c or --slingHome doesn't matter. Either way results in two homes "launcher" and "sling."
    • ls launcher shows folders: framework logs repository resources
    • ls sling shows folders: conf repository
  • In the test below, 127.0.0.1:50500 is specified control port. Using this to check status, doesn't work
    • java -jar ../org.apache.sling.kickstart-0.0.2.jar --control=127.0.0.1:50500 status

Ideas?

#!/bin/bash

KICKSTART_VER=0.0.2
HTTP_PORT=8080
RUNMODES=author,notshared,oak_tar_fds
CONTROL_ADDR=127.0.0.1:50500
PATH_TO_KICKSTART_FILES=/Users/cris/sling-instances
MAIN_FEATURE_FILE=feature-oak_tar_fds.json

JAVA_OPTS="
  -Djava.awt.headless=true \
  -Duser.timezone=America/Detroit \
  -Dnashorn.args=--no-deprecation-warning   
  "
# options: 
#     author,publish,local,live
#     notshared,notshared
#     oak_tar,mongo
# author control addr 127.0.0.1:50500
# publish control addr 127.0.0.1:50501

KICKSTART_OPTS="
  -c sling \
  --port=$HTTP_PORT \
  --mainFeature=$PATH_TO_KICKSTART_FILES/$MAIN_FEATURE_FILE \
  --control=$CONTROL_ADDR \
  -Dsling.runmodes=$RUNMODES    
"

java $JAVA_OPTS -jar $PATH_TO_KICKSTART_FILES/org.apache.sling.kickstart-$KICKSTART_VER.jar start $KICKSTART_OPTS &

@cmrockwell
Copy link
Author

cmrockwell commented Sep 1, 2020

In the short run, my project start.sh will probably look more like this one. which is basically the same way as @GastonGonzalez 's DockerFile setup. This avoids certain issues mentioned above, and matches the way I've been running and testing locally. Though I could see switching to Kickstart after the initial merge.

#!/bin/bash

LAUNCHER_PATH=/Users/cris/sling-instances
LAUNCHER_JAR=org.apache.sling.feature.launcher.jar
HTTP_PORT=8080
RUNMODES=author,notshared,oak_tar_fds
MAIN_FEATURE_FILE=feature-oak_tar_fds.json

JAVA_OPTS="
  -Djava.awt.headless=true \
  -Duser.timezone=America/Detroit \
  -Dnashorn.args=--no-deprecation-warning   
  "

APP_OPTS="
  -f $LAUNCHER_PATH/$MAIN_FEATURE_FILE \
  -D sling.runmodes=$RUNMODES \
  -D org.osgi.service.http.port=$HTTP_PORT \
  -p sling
"

java $JAVA_OPTS -jar $LAUNCHER_PATH/$LAUNCHER_JAR start $APP_OPTS &

@GastonGonzalez
Copy link

I created this issue to add support for the Kickstarter. Once this ticket is resolved, I'll take this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants