- General présentation of the application
- Running the application
The ARC (from the French: Acquisition - Réception - Contrôles) software allows receiving (administrative) data supplied by the providers (several formats are supported, particularly XML), to control the compliance of the received files, and to transform administrative data to elementary statistical data. The software enables the statistician to define and apply controls and mappings, to test them in a sandbox environment (linked to the software), and to put them into production without frequently calling on a developer.
These functionnalities/services aim the statistician’s independence and ability to adapt to the data evolutions, thereby avoiding impacts on the statistical chain.
The ARC application is a java 8 application, working with a PostgreSQL > 9.6 database. To run the app you will need this PostgreSQL DB and configure the connection in the arc.properties file. Once this is done
The easiest way to run the ARC application is with docker, without modifying the code, you can easily pass some configuration like :
- maven build configuration
- database configuration
- log configuration
Because you could want to build the app with some custom maven settings or behind a proxy, there is 3 way to build the web app.
-
The easy peasy way. If you don't need proxy or custom settings just run
docker build -f app.Dockerfile -t arc .
-
Behind a proxy. To run the maven phase behind a proxy you have to specify it. We created two args to pass the proxy settings to maven. If your proxy environnement variables are set, run
docker build -f app.Dockerfile \ --build-arg HTTP_PROXY=${HTTP_PROXY} \ --build-arg HTTPS_PROXY=${HTTPS_PROXY} \ -t arc \ .
otherwise replace ${HTTP_PROXY} and ${HTTPS_PROXY} by your proxies.
-
with maven settings. Finaly if you what to fully configure maven, add a maven settings.xml file in the ARC directory and run :
docker build -f app.Dockerfile \ --build-arg MAVEN_SETTINGS=path/to/maven/settings.xml \ -t arc \ .
To configure the web application to use your database just pass the url, user and password in the docker build phases like this :
docker build -f app.Dockerfile \
--build-arg DATABASE_URL=jdbc:postgresql://your.db.url/schema \
--build-arg DATABASE_USER=aValidUser \
--build-arg DATABASE_PASSWORD=aValidPassword \
-t arc \
.
If you want to configure the log without modifying the code of the application, pass the output log file and it path, the log level and a custom log4j.xml file to the docker build phase like this :
docker build -f app.Dockerfile \
--build-arg LOG_PATH= the/path/to/output.log #logs/log-arc.log by default \
--build-arg LOG_LEVEL= #ERROR by default \
--build-arg LOG_SETTINGS= #fr/insee/config/log4j.xml by default \
-t arc \
.
docker build -f app.Dockerfile \
--build-arg HTTP_PROXY= #optionnal \
--build-arg HTTPS_PROXY= #optionnal \
--build-arg MAVEN_SETTINGS= #optionnal \
--build-arg DATABASE_URL= \
--build-arg DATABASE_USER= \
--build-arg DATABASE_PASSWORD= \
--build-arg LOG_PATH= #optionnal \
--build-arg LOG_LEVEL= #optionnal \
--build-arg LOG_SETTINGS= #optionnal\
-t arc \
.
After the image build,
docker run -p 8080:8080 arc
If you want do not have a postgreSQL database ready and want to try the app on the fly use docker-compose. It will build the wep application, the database ans link them. So just run
docker-compose up
The ARC web-user application component uses an apache/tomcat server with version 8.5 or higher.
Add to the tomcat service or tomcat runner the parameter -Dproperties.path= to set up the directory location of properties files
For example in catalina.bat, the JAVA_OPTS parameters may be changed as followed
set "JAVA_OPTS=%JAVA_OPTS% -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dproperties.file=D:\apache-tomcat-8.5.38\webapps\"
Change the file resources-prod.properties to configure the database connections, the root directory of the filesystem used by ARC and eventually the path to log4j configuration files See "Java configuration parameters" for more informations
- Stop tomcat server
- Delete the content of the temporary tomcat directories namely "temp" and "work" directories
- Copy arc-web.war into the "webapps" tomcat directory
- Copy the resources-prod.properties to the properties directory
- Start tomcat server
In a web browser go to localhost:8080/status.action. The status action returns :
- 0 - No error detected
- 201 - Database error connection
Change the host ip adress and port number according to the tomcat server and tomcat ARC application context configuration.
For more information about the installation go check the Install guide