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

In-memory SDLC server backend #675

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
9 changes: 9 additions & 0 deletions legend-sdlc-server-demo/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM eclipse-temurin:11.0.17_8-jdk-jammy
COPY target/legend-sdlc-server-demo-*-shaded.jar /app/bin/
COPY src/main/resources/docker/config /config
CMD java -cp /app/bin/*.jar \
-XX:+ExitOnOutOfMemoryError \
-XX:MaxRAMPercentage=60 \
-Xss4M \
-Dfile.encoding=UTF8 \
org.finos.legend.sdlc.server.demo.LegendSDLCServerForDemo server /config/config.json
197 changes: 197 additions & 0 deletions legend-sdlc-server-demo/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>legend-sdlc</artifactId>
<groupId>org.finos.legend.sdlc</groupId>
<version>0.135.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>legend-sdlc-server-demo</artifactId>
<name>Legend SDLC Server - Demo</name>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<configuration>
<rules>
<bannedDependencies>
<includes combine.children="append">
<include>org.slf4j:jcl-over-slf4j:${slf4j.version}</include>
<include>org.slf4j:jul-to-slf4j:${slf4j.version}</include>
<include>ch.qos.logback:logback-access</include>
<include>ch.qos.logback:logback-classic</include>
<include>ch.qos.logback:logback-core</include>
</includes>
</bannedDependencies>
</rules>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<shadedArtifactAttached>true</shadedArtifactAttached>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.finos.legend.sdlc.server.LegendSDLCServer</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<!-- SDLC -->
<dependency>
<groupId>org.finos.legend.sdlc</groupId>
<artifactId>legend-sdlc-model</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.sdlc</groupId>
<artifactId>legend-sdlc-server-shared</artifactId>
<exclusions>
<exclusion>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
</exclusion>
<exclusion>
<groupId>org.glassfish.hk2.external</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.finos.legend.sdlc</groupId>
<artifactId>legend-sdlc-extensions-collection-entity-serializer</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.finos.legend.sdlc</groupId>
<artifactId>legend-sdlc-server</artifactId>
<exclusions>
<exclusion>
<groupId>org.gitlab4j</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- SDLC -->

<!-- ENGINE -->
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-protocol-pure</artifactId>
</dependency>

<!-- ECLIPSE COLLECTIONS -->
<dependency>
<groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections-api</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections</artifactId>
</dependency>
<!-- ECLIPSE COLLECTIONS -->

<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-servlet</artifactId>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
</dependency>

<dependency>
<groupId>com.hubspot.dropwizard</groupId>
<artifactId>dropwizard-guicier</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-core</artifactId>
</dependency>

<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>

<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

<!-- TEST -->
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-testing</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright 2023 Goldman Sachs
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.finos.legend.sdlc.server.backend.simple.api.backup;

import org.finos.legend.sdlc.domain.model.project.workspace.WorkspaceType;
import org.finos.legend.sdlc.server.backend.simple.exception.UnavailableFeature;
import org.finos.legend.sdlc.server.domain.api.backup.BackupApi;

import javax.inject.Inject;

public class SimpleBackendBackupApi implements BackupApi
{
@Inject
public SimpleBackendBackupApi()
{
}

@Override
public void discardBackupWorkspace(String projectId, String workspaceId, WorkspaceType workspaceType)
{
UnavailableFeature.exception();
}

@Override
public void recoverBackupWorkspace(String projectId, String workspaceId, WorkspaceType workspaceType, boolean forceRecovery)
{
UnavailableFeature.exception();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2023 Goldman Sachs
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.finos.legend.sdlc.server.backend.simple.api.build;

import org.finos.legend.sdlc.domain.model.build.Build;
import org.finos.legend.sdlc.domain.model.build.BuildStatus;
import org.finos.legend.sdlc.server.backend.simple.exception.UnavailableFeature;
import org.finos.legend.sdlc.server.domain.api.build.BuildAccessContext;

import java.util.List;

public class SimpleBackendBuildAccessContext implements BuildAccessContext
{
@Override
public Build getBuild(String buildId)
{
throw UnavailableFeature.exception();
}

@Override
public List<Build> getBuilds(Iterable<String> revisionIds, Iterable<BuildStatus> statuses, Integer limit)
{
throw UnavailableFeature.exception();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Copyright 2023 Goldman Sachs
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.finos.legend.sdlc.server.backend.simple.api.build;

import org.finos.legend.sdlc.domain.model.project.workspace.WorkspaceType;
import org.finos.legend.sdlc.domain.model.version.VersionId;
import org.finos.legend.sdlc.server.backend.simple.exception.UnavailableFeature;
import org.finos.legend.sdlc.server.domain.api.build.BuildAccessContext;
import org.finos.legend.sdlc.server.domain.api.build.BuildApi;
import org.finos.legend.sdlc.server.project.ProjectFileAccessProvider;

import javax.inject.Inject;

public class SimpleBackendBuildApi implements BuildApi
{
@Inject
public SimpleBackendBuildApi()
{
}

@Override
public BuildAccessContext getProjectBuildAccessContext(String projectId)
{
throw UnavailableFeature.exception();
}

@Override
public BuildAccessContext getWorkspaceBuildAccessContext(String projectId, String workspaceId, WorkspaceType workspaceType, ProjectFileAccessProvider.WorkspaceAccessType workspaceAccessType)
{
throw UnavailableFeature.exception();
}

@Override
public BuildAccessContext getVersionBuildAccessContext(String projectId, VersionId versionId)
{
throw UnavailableFeature.exception();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright 2023 Goldman Sachs
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.finos.legend.sdlc.server.backend.simple.api.comparison;

import org.finos.legend.sdlc.domain.model.comparison.Comparison;
import org.finos.legend.sdlc.domain.model.project.workspace.WorkspaceType;
import org.finos.legend.sdlc.server.backend.simple.exception.UnavailableFeature;
import org.finos.legend.sdlc.server.domain.api.comparison.ComparisonApi;

import javax.inject.Inject;

public class SimpleBackendComparisonApi implements ComparisonApi
{
@Inject
public SimpleBackendComparisonApi()
{
}

@Override
public Comparison getWorkspaceCreationComparison(String projectId, String workspaceId, WorkspaceType workspaceType)
{
throw UnavailableFeature.exception();
}

@Override
public Comparison getWorkspaceProjectComparison(String projectId, String workspaceId, WorkspaceType workspaceType)
{
throw UnavailableFeature.exception();
}

@Override
public Comparison getReviewComparison(String projectId, String reviewId)
{
throw UnavailableFeature.exception();
}

@Override
public Comparison getReviewWorkspaceCreationComparison(String projectId, String reviewId)
{
throw UnavailableFeature.exception();
}
}
Loading