Skip to content

Latest commit

 

History

History
232 lines (175 loc) · 10.6 KB

readme.md

File metadata and controls

232 lines (175 loc) · 10.6 KB

There is currently a problem with testng, run on branch testng740 as described under the heading "Updating with a new non master version of eclipse dev environment" (can be run when doing a new install)

cora-eclipse

Cora-eclipse is a project to enable easy setup of an Eclipse install for Cora development, using Eclipse and Docker.
I am running this on linux so, change as needed for other platforms.

Before you begin

  1. Make sure you have git and docker set up on your local machine
  2. Make a directory where you want everything installed /x/y/z/cora (/mnt/depot/cora)
  3. cd to your new directory
  4. Clone this repository: git clone https://github.com/olovm/cora-eclipse.git

Installing, runAll

The runAll script will take you through the entire process of setting up a docker based development environment for Cora. It will go through all needed steps.
You can get your docker group id by running; getent group docker

Run:
./cora-eclipse/runAll.sh dockerGroupId
or run:
./cora-eclipse/runAll.sh dockerGroupId master nocache
This option will do a pull of the base image, and not use the cache so that you get the latest version of the packages that gets installed from Fedora.

This scrip will, run the following headers automatically

Build docker image

Automatically run by runAll
this will take some time as it downloads quite a few things, eclipse, tomcat, etc

Create directories on host

Automatically run by runAll

  1. workspace (for your eclipse workspace)
  2. eclipse (for your eclipse installation)
  3. eclipseP2 (for files shared between multiple installations of eclipse)
  4. m2 (for maven files)

Docker first run installing eclipse

Automatically run by runAll

Eclipse installation

When the container starts for the first time will it run the installation part of entrypoint.sh. This will clone all Cora repositories, add other remotes to all of them, install needed npm karma in cora-jsclient and start the eclipse installer (oomph).
There are a few things that needs to be choosen in the installer:

  1. You need to use the advanced mode

  2. Browse for setup files for eclipse, /home/yourUserName/workspace/cora-eclipse/oomph/EclipseForCora.setup (use the plussign to add)

  3. Java 17+ VM, set it to: /usr/lib/jvm/java-17-openjdk

  4. Use release 202206 (there are some problems with the other ones)

next step

  1. In next step browse for setup for projects, /home/yourUserName/workspace/cora-eclipse/oomph/CoraProjects.setup (use the plussign to add)
  2. Make sure "Cora projects" are marked

next step

  1. Choose installation location: "Installed in the specified absolute folder location"
  2. Fill in path for "Root install folder": set it to /home/yourUserName/eclipse
  3. Fill in path for "Installation location": set it to /home/yourUserName/eclipse
  4. Choose Workspace location rule: "Located in the absolute folder location"
  5. Fill in path for "Workspace location": /home/yourUserName/workspace
  6. Fill in path for "JRE 17 Location": /usr/lib/jvm/java-17-openjdk

next step

finnish

saros might not allow you to log in, if so, skipp that step and do it later
This should get you through the installer and will eventually start eclipse and do a first run to setup eclipse. You can click on the spinning arrows, in the bottom of the screen to see what the setup does.
Once the setuptask are finnished, no more spinning arrows, close eclipse, and then close the installer window.
You are now ready to do a first startup of the environment.

Finishing up, your first startup of the environment


Saros not working on later java > 11
saros-project/saros#1142
https://newbedev.com/how-to-run-eclipse-in-clean-mode-what-happens-if-we-do-so

docker exec -it eclipse202309forcora2 bash
copy saros.core_0.2.0.jar (fixed one) from
cp /home/olov/workspace/cora-eclipse/docker/saros.core_0.2.0.jar /home/olov/.p2/pool/plugins/
nano /home/olov/eclipse/eclipseforcora/eclipse.ini

add
-clean
to first row
restart eclipse

Start the environment by running:
./eclipseForCora/startEclipseForCora.sh
Do the following in the listed order to avoid problems!

  1. Go in under preferences and make sure the latest java is choosen as default jre
  2. In project explorer, under the three little dots, deselect working sets
  3. Mark all projects and refresh them, menu or F5 (this will make sure eclipse sees files in target folders)
  4. Go under External Tools Configurations (play icon with toolbox), run mvnPomCleanInstallAllButDocker
  5. Go under External Tools Configurations (play icon with toolbox), run mvnPomCleanInstallDevDocker
  6. Rightclick any project, and choose, maven / update project... (or F5) select all projects and run
  7. Stop and start containers and tomcat servers.

Start systemOne

  1. Go under External Tools Configurations (play icon with toolbox) and start the docker containers for development by running systemoneStartDevDockers
  2. Start fitnesse, Go under Run Configurations (play icon) and start fitnesse
  3. Start the tomcat servers for systemOne
  4. See links section below to find the running system

(or similar for Alvin or DiVA)

Links

After starting the appropriate servers and containers from inside eclipse, the following will be exposed:

SystemOne

SystemOne web:http://localhost:38080/jsclient/theClient.html
Fitnesse:http://localhost:38090/fitnesse/FrontPage
SystemOne REST:http://localhost:38080/systemone/rest/
Solr:http://localhost:38983/solr/
RabbitMQ:http://localhost:15672/guest/guest
Karma:http://localhost:39876/
Fedora Commons:http://localhost:38087/fcrepo/

Alvin

Alvin web:http://localhost:38081/jsclient/theClient.html
Fitnesse:http://localhost:38091/fitnesse/FrontPage
Alvin REST:http://localhost:38081/alvin/rest/
Solr:http://localhost:38984/solr/
RabbitMQ:http://localhost:15673/guest/guest
Fedora Commons:http://localhost:38088/fedora/

DiVA

DiVA web:http://localhost:38082/jsclient/theClient.html
Fitnesse:http://localhost:38092/fitnesse/FrontPage
DiVA REST:http://localhost:38082/diva/rest/
Solr:http://localhost:38985/solr/
RabbitMQ:http://localhost:15674/guest/guest
Fedora Commons:http://localhost:38089/fedora/

Commiting to github using token

generate a github token

as described here:

https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-token

push to git with token

username: your normal username password: your token

Updating

Updating to a newer version of developed systems

  1. Set your username in .gitconfig found in the root catalog where you installed the system, do this from the host system as there currently seems to be some issue with setting information in the file from the docker side of things.
    [user]
    name = yourusername
    email = [email protected]
  2. Go under External Tools Configurations (play icon with toolbox), run fetchAllFromLSU
  3. Go under External Tools Configurations (play icon with toolbox), run mergeProjectsFromLSUMaster (confirm in console)
  4. Go under External Tools Configurations (play icon with toolbox), run mvnPomCleanInstallAllButDocker
  5. Go under External Tools Configurations (play icon with toolbox), run mvnPomCleanInstallDevDocker
  6. Rightclick any project, and choose, maven / update project... (or F5) select all projects and run
  7. Stop and start containers and tomcat servers.

Updating with a new non master version of eclipse dev environment

  1. cd to your eclipse install directory cd /x/y/z/cora/cora-eclipse
  2. do a git pull: git pull
  3. list remote branches: git ls-remote
  4. checkout latest branch: git checkout 201903_2
  5. cd up to cora directory: cd ..
  6. run: ./cora-eclipse/runAll.sh 1001 201903_2
  7. continue with installation

Other

Adding cert information for connection to Fedora Commons

For alvin server go into the launch configuration / arguments under VM arguments add
-Djavax.net.ssl.trustStore="/home/olov/workspace/cora-docker-fedora/files/fedoraKeystore.jks" -Djavax.net.ssl.trustStorePassword="changeit"

Build all tags

  1. Go under External Tools Configurations (play icon with toolbox) and run checkOutLatestTagOfAllProjects
  2. Go under External Tools Configurations (play icon with toolbox) and run mvnPomCleanInstallAllButDocker
  3. Go under External Tools Configurations (play icon with toolbox) and run checkOutMasterOfAllProjects

For adding marketplace to oomph installer (note to self)

https://stackoverflow.com/questions/47582157/eclipse-marketplace-plug-ins-silent-install Given a Marketplace install URL (https://marketplace.eclipse.org/marketplace-client-intro?mpc_install={ID}), construct the API URL as https://marketplace.eclipse.org/node/{ID}/api/p. Retrieve the XML file from that URL and look for the repository URL in the updateURL tag, and the available features in the ius tag. You'll need to append .feature.group to each IU feature listed

exporting data from connected databases

connect to shell in devEnvironment:

docker exec -it eclipse202309forcora2 bash

to export data from running DiVA db run: pg_dump -U diva -h diva-cora-docker-postgresql -p 5432 -t organisation diva > ~/workspace/diva-cora-docker-postgresql/docker/data/exported.sql

Debugging FitNesse

Add the following to the top of the page, then use remoteDebugging such as DivaFitnesseDebug to connect to it when testing.

!path {java.class.path}
!define COMMAND_PATTERN {/usr/lib/jvm/java-17-openjdk/bin/java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -cp %p %m}

Archive

If problems with archive test for path not found: enter docker:

docker exec -it eclipse202212forcora4 bash

go to your home dir:

cd /home/yourUserName

create needed dir in temp:

mkdir /tmp/sharedArchiveReadable

run archive readable:

./archiveReadable.sh