Skip to content

concord-server, concord-console2: use webapp plugin #1154

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions console2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,6 @@ The dev mode has the following limitations:
In order to use those features, you need to run the UI in production
mode (see below).

## Building and Running in Production Mode

```bash
../mvnw clean install
```

Specify the path to the `build` directory when you start
[the Server](../server/dist):
```
BASE_RESOURCE_PATH=/path/to/repository/concord/console2/build
```

The UI will be accessible on http://localhost:8080

**Note:** avoid using symlinks in BASE_RESOURCE_PATH.

## Custom Server URL

The `proxy` property in the [package.json](./package.json) file is used to
Expand Down
22 changes: 0 additions & 22 deletions console2/assembly/dist.xml

This file was deleted.

2 changes: 1 addition & 1 deletion console2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
},
"scripts": {
"start": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start",
"build": "export SET NODE_OPTIONS=--openssl-legacy-provider && ./npm.sh run hack:remove-sui-css-dep && react-scripts build",
"build": "export SET NODE_OPTIONS=--openssl-legacy-provider && ./npm.sh run hack:remove-sui-css-dep && export SET BUILD_PATH='./target/classes/META-INF/console2' && react-scripts build",
"hack:remove-sui-css-dep": "shx --silent sed -i @import /*import node_modules/semantic-ui-css/semantic.min.css > /dev/null 2>&1",
"dev": "export SET NODE_OPTIONS=--openssl-legacy-provider && babel-node --presets es2015 scripts/devServer.js",
"test": "react-scripts test",
Expand Down
4 changes: 4 additions & 0 deletions console2/package/META-INF/concord/webapp.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
path=/
checksumsFileResourcePath=META-INF/console2.checksums.cvs
resourceRoot=META-INF/console2/
indexHtmlRelativePath=index.html
56 changes: 45 additions & 11 deletions console2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>

<artifactId>concord-console2</artifactId>
<packaging>pom</packaging>
<packaging>jar</packaging>

<properties>
<skipNpm>false</skipNpm>
Expand Down Expand Up @@ -79,22 +79,56 @@
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>assembly</id>
<phase>package</phase>
<id>copy-package-descriptor</id>
<phase>prepare-package</phase>
<goals>
<goal>single</goal>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/classes</outputDirectory>
<resources>
<resource>
<directory>package</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.nicoulaj.maven.plugins</groupId>
<artifactId>checksum-maven-plugin</artifactId>
<version>1.11</version>
<executions>
<execution>
<id>create-checksum-file</id>
<phase>prepare-package</phase>
<goals>
<goal>files</goal>
</goals>
<configuration>
<fileSets>
<fileSet>
<directory>${project.build.directory}/classes/META-INF/console2</directory>
<includes>
<include>**/*.*</include>
</includes>
</fileSet>
</fileSets>
<algorithms>
<algorithm>SHA-1</algorithm>
</algorithms>
<csvSummaryFile>classes/META-INF/console2.checksums.cvs</csvSummaryFile>
<includeRelativePath>true</includeRelativePath>
</configuration>
</execution>
</executions>
<configuration>
<tarLongFileMode>posix</tarLongFileMode>
<descriptors>
<descriptor>${basedir}/assembly/dist.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
2 changes: 0 additions & 2 deletions docker-images/server/oss/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ LABEL maintainer="[email protected]"
EXPOSE 8001

ADD --chown=concord:concord target/dist/server.tar.gz /opt/concord/server/
ADD --chown=concord:concord target/dist/console.tar.gz /opt/concord/console/

RUN mkdir -p /opt/concord/server/logs && \
chown -R concord:concord /opt/concord/server/logs

USER concord

ENV BASE_RESOURCE_PATH=/opt/concord/console/
CMD ["bash", "/opt/concord/server/start.sh"]
22 changes: 0 additions & 22 deletions docker-images/server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,6 @@
</properties>

<dependencies>
<dependency>
<groupId>com.walmartlabs.concord</groupId>
<artifactId>concord-console2</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- dependency tree fix for mvnd -->
<dependency>
<groupId>com.walmartlabs.concord.server</groupId>
Expand Down Expand Up @@ -73,14 +59,6 @@
<classifier>dist</classifier>
<destFileName>server.tar.gz</destFileName>
</artifactItem>
<artifactItem>
<groupId>com.walmartlabs.concord</groupId>
<artifactId>concord-console2</artifactId>
<version>${project.version}</version>
<type>tar.gz</type>
<classifier>dist</classifier>
<destFileName>console.tar.gz</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
Expand Down
2 changes: 1 addition & 1 deletion examples/custom_task/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<plugin>
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
<version>0.3.3</version>
<version>0.9.0.M4</version>
<executions>
<execution>
<id>index</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* =====
*/

import ca.ibodrov.concord.webapp.WebappPluginModule;
import com.google.common.collect.ImmutableMap;
import com.google.inject.Module;
import com.typesafe.config.Config;
Expand Down Expand Up @@ -73,7 +74,8 @@ public synchronized TestingConcordServer start() throws Exception {

var config = prepareConfig(db);
var system = new ConcordServerModule(config);
var allModules = Stream.concat(extraModules.stream().map(f -> f.apply(config)), Stream.of(system)).toList();
var webapp = new WebappPluginModule();
var allModules = Stream.concat(extraModules.stream().map(f -> f.apply(config)), Stream.of(system, webapp)).toList();
server = ConcordServer.withModules(allModules)
.start();

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
<plugin>
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
<version>0.3.3</version>
<version>0.9.0.M4</version>
<executions>
<execution>
<id>index</id>
Expand Down
10 changes: 10 additions & 0 deletions server/dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@
<artifactId>oidc</artifactId>
</dependency>

<!-- ui -->
<dependency>
<groupId>com.walmartlabs.concord</groupId>
<artifactId>concord-console2</artifactId>
</dependency>
<dependency>
<groupId>com.walmartlabs.concord.server.plugins</groupId>
<artifactId>webapp</artifactId>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand Down
4 changes: 0 additions & 4 deletions server/dist/src/main/resources/concord-server.conf
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ concord-server {
accessLogRetainDays = 7
accessLogRetainDays = ${?ACCESS_LOG_RETAIN_DAYS}

# a path to a directory that will be served on "/"
# typically, it should point to a directory with the UI's files
baseResourcePath = ${?BASE_RESOURCE_PATH}

# maximum size of request headers, bytes
requestHeaderSize = 16384
requestHeaderSize = ${?REQUEST_HEADER_SIZE}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* =====
*/

import com.walmartlabs.concord.server.boot.resteasy.ApiDescriptor;
import com.walmartlabs.concord.server.sdk.rest.ApiDescriptor;
import com.walmartlabs.concord.server.cfg.ServerConfiguration;
import org.eclipse.jetty.ee8.nested.SessionHandler;
import org.eclipse.jetty.ee8.servlet.FilterHolder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* =====
*/

import com.walmartlabs.concord.server.sdk.rest.ApiDescriptor;

public class ConcordApiDescriptor implements ApiDescriptor {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import com.google.inject.Binder;
import com.google.inject.Module;
import com.walmartlabs.concord.server.sdk.rest.ApiDescriptor;
import com.walmartlabs.concord.server.sdk.rest.Component;

import javax.servlet.ServletContextListener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public class ConsoleModule implements Module {

@Override
public void configure(Binder binder) {
bindServletHolder(binder, ConsoleServletHolder.class);

binder.bind(CustomFormServiceV1.class).in(SINGLETON);
binder.bind(CustomFormServiceV2.class).in(SINGLETON);

Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions server/plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
<module>oidc</module>
<module>oneops</module>
<module>pfed-sso</module>
<module>webapp</module>
</modules>
</project>
3 changes: 3 additions & 0 deletions server/plugins/webapp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# webapp

A concord-server plugin to serve SPAs.
Loading