headwirecom / percli

peregrine cli tool
Apache License 2.0
3 stars 10 forks source link

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

Open cmrockwell opened 4 years ago

cmrockwell commented 4 years ago

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 commented 4 years ago

@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 commented 4 years ago

@reusr1 That sounds like a great idea

cmrockwell commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

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 commented 4 years ago

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 commented 4 years ago

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