Skip to content

Commit

Permalink
Merge branch 'master' into release-0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gsunner committed Nov 7, 2018
2 parents c769c2b + 7251ee2 commit ec16b42
Show file tree
Hide file tree
Showing 244 changed files with 22,724 additions and 5,678 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,9 @@ wrappers/python/fbs/
#ONNX example
examples/models/onnx_resnet50/cpu_codegen/Function_0_codegen.cpp
examples/models/onnx_resnet50/resnet.onnx

#openapi
engine/src/main/resources/static/seldon.json
api-frontend/src/main/resources/static/seldon.json
wrappers/python/seldon.json

34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# Change Log

## [v0.2.3](https://github.com/SeldonIO/seldon-core/tree/v0.2.3) (2018-09-17)
[Full Changelog](https://github.com/SeldonIO/seldon-core/compare/v0.2.2...v0.2.3)

**Closed issues:**

- R wrapper s2i environment documentation missing Model file extension [\#219](https://github.com/SeldonIO/seldon-core/issues/219)
- Provide example using ONNX via Intel nGraph for inference [\#214](https://github.com/SeldonIO/seldon-core/issues/214)
- how to explore grafana dashboard for seldon-core in web ui [\#209](https://github.com/SeldonIO/seldon-core/issues/209)
- APPLICATION FAILED TO START - Example python notebook \(fx-market-predictor\) [\#208](https://github.com/SeldonIO/seldon-core/issues/208)
- dev guide doc: develop/test changes locally? [\#202](https://github.com/SeldonIO/seldon-core/issues/202)
- Service orchestrator updated when surrounding deployment changed [\#199](https://github.com/SeldonIO/seldon-core/issues/199)
- UnknownHostException: seldon-deployment [\#194](https://github.com/SeldonIO/seldon-core/issues/194)
- grafana dashboard [\#192](https://github.com/SeldonIO/seldon-core/issues/192)
- Add image versions to all wrapper images [\#136](https://github.com/SeldonIO/seldon-core/issues/136)
- Status is not created in Custom Resource on initial create or update [\#74](https://github.com/SeldonIO/seldon-core/issues/74)

**Merged pull requests:**

- Update SeldonDeployment status for lifecycle conditions [\#223](https://github.com/SeldonIO/seldon-core/pull/223) ([cliveseldon](https://github.com/cliveseldon))
- Update use of python wrappers to version 0.2 [\#222](https://github.com/SeldonIO/seldon-core/pull/222) ([cliveseldon](https://github.com/cliveseldon))
- Support for ONNX exported models for inference [\#221](https://github.com/SeldonIO/seldon-core/pull/221) ([cliveseldon](https://github.com/cliveseldon))
- Private repo build and run [\#220](https://github.com/SeldonIO/seldon-core/pull/220) ([gsunner](https://github.com/gsunner))
- Nodejs s2i wrapper for JavaScript models [\#218](https://github.com/SeldonIO/seldon-core/pull/218) ([SachinVarghese](https://github.com/SachinVarghese))
- Update seldon metrics [\#217](https://github.com/SeldonIO/seldon-core/pull/217) ([cliveseldon](https://github.com/cliveseldon))
- fix oauth\_port check in api-tester [\#213](https://github.com/SeldonIO/seldon-core/pull/213) ([cliveseldon](https://github.com/cliveseldon))
- Add configurable timeouts for REST and gRPC [\#211](https://github.com/SeldonIO/seldon-core/pull/211) ([cliveseldon](https://github.com/cliveseldon))
- Config circular bug [\#210](https://github.com/SeldonIO/seldon-core/pull/210) ([cliveseldon](https://github.com/cliveseldon))
- Update for flatbuffers python wrappers [\#205](https://github.com/SeldonIO/seldon-core/pull/205) ([cliveseldon](https://github.com/cliveseldon))
- Experimental Flatbuffers based protocol for python wrapper [\#204](https://github.com/SeldonIO/seldon-core/pull/204) ([cliveseldon](https://github.com/cliveseldon))
- Change wrappers to be versioned and update examples and docs [\#201](https://github.com/SeldonIO/seldon-core/pull/201) ([cliveseldon](https://github.com/cliveseldon))
- Update istio example notebook [\#200](https://github.com/SeldonIO/seldon-core/pull/200) ([cliveseldon](https://github.com/cliveseldon))
- Allow Annotations to allow customizations [\#197](https://github.com/SeldonIO/seldon-core/pull/197) ([cliveseldon](https://github.com/cliveseldon))
- Removed subtype from deployment example [\#195](https://github.com/SeldonIO/seldon-core/pull/195) ([hanneshapke](https://github.com/hanneshapke))

## [v0.2.2](https://github.com/SeldonIO/seldon-core/tree/v0.2.2) (2018-07-18)
[Full Changelog](https://github.com/SeldonIO/seldon-core/compare/v0.2.1...v0.2.2)

Expand Down
4 changes: 3 additions & 1 deletion api-frontend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ VERSION_FILE=target/version.txt
write_version:
ls target/seldon-apife-*.jar | sed -n 's/target\/seldon-apife-\(.*\).jar$$/\1/p' > $(VERSION_FILE) && cat $(VERSION_FILE)

build_jar: update_proto
build_jar: update_proto update_swagger
mvn clean verify -Dlicense.useMissingFile -B

build_image: build_jar write_version
Expand Down Expand Up @@ -52,3 +52,5 @@ port_forward_api_server:
POD_NAME=$$(kubectl --namespace default get pod -l app=seldon-apiserver-container-app -o template --template="{{(index .items 0).metadata.name}}") && \
kubectl port-forward $${POD_NAME} 8080:8080

update_swagger:
cp -v ../openapi/apife.oas3.json src/main/resources/static/seldon.json
4 changes: 3 additions & 1 deletion api-frontend/Makefile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LOCAL_PRIVATE_REPO=127.0.0.1:5000
build: clean build_image


build_jar: update_proto
build_jar: update_proto update_swagger
@set -x && mvn clean verify -Dlicense.useMissingFile -B

write_version: build_jar
Expand Down Expand Up @@ -47,3 +47,5 @@ update_proto: download_protos
cp -vr ../proto/k8s/k8s.io src/main/proto
cp -v ../proto/k8s/v1.proto src/main/proto

update_swagger:
cp -v ../openapi/apife.oas3.json src/main/resources/static/seldon.json
32 changes: 26 additions & 6 deletions api-frontend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.7.RELEASE</version>
<version>1.5.17.RELEASE</version>
</parent>

<groupId>io.seldon.apife</groupId>
<artifactId>seldon-apife</artifactId>
<version>0.2.3</version>
<version>0.2.4</version>
<packaging>jar</packaging>

<name>api-frontend</name>
Expand All @@ -35,6 +35,26 @@
</extensions>

<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.2</version>
<executions>
<execution>
<id>jacoco-initialize</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
Expand Down Expand Up @@ -146,12 +166,12 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.8.6</version>
<version>2.8.11</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.6</version>
<version>2.8.11.2</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
Expand All @@ -175,7 +195,7 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.4</version>
<version>4.5.6</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -228,7 +248,7 @@
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.40</version>
<version>5.1.47</version>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.springframework.http.MediaType;
import org.springframework.http.RequestEntity;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseStatus;
Expand Down Expand Up @@ -122,7 +123,7 @@ String ping() {
return "pong";
}


@CrossOrigin(origins = "*")
@RequestMapping(value = "/api/v0.1/predictions", method = RequestMethod.POST, consumes = "application/json; charset=utf-8", produces = "application/json; charset=utf-8")
public ResponseEntity<String> prediction(RequestEntity<String> requestEntity,Principal principal) {

Expand Down Expand Up @@ -172,6 +173,7 @@ public ResponseEntity<String> prediction(RequestEntity<String> requestEntity,Pri

}

@CrossOrigin(origins = "*")
@RequestMapping(value = "/api/v0.1/feedback", method = RequestMethod.POST, consumes = "application/json; charset=utf-8", produces = "application/json; charset=utf-8")
@ResponseStatus(value = HttpStatus.OK)
public void feedback(RequestEntity<String> requestEntity, Principal principal)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package io.seldon.apife.config;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Component
@Order(Ordered.HIGHEST_PRECEDENCE)
public class SimpleCorsFilter implements Filter {

public SimpleCorsFilter() {
}

@Override
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
HttpServletResponse response = (HttpServletResponse) res;
HttpServletRequest request = (HttpServletRequest) req;
response.setHeader("Access-Control-Allow-Origin", "*");
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
response.setHeader("Access-Control-Max-Age", "3600");
//response.setHeader("Access-Control-Allow-Headers", "x-requested-with, authorization");
response.setHeader("Access-Control-Allow-Headers", "API-Key, accept, Content-Type, x-requested-with, authorization");
if ("OPTIONS".equalsIgnoreCase(request.getMethod())) {
response.setStatus(HttpServletResponse.SC_OK);
} else {
chain.doFilter(req, res);
}
}

@Override
public void init(FilterConfig filterConfig) {
}

@Override
public void destroy() {
}
}
Empty file.
3 changes: 3 additions & 0 deletions cluster-manager/README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Local testing:

export ENGINE_CONTAINER_IMAGE_PULL_POLICY=IfNotPresent
export SELDON_CLUSTER_MANAGER_POD_NAMESPACE=seldon
export ENGINE_CONTAINER_IMAGE_AND_VERSION=seldonio/engine:<VERSION>

mvn spring-boot:run
24 changes: 22 additions & 2 deletions cluster-manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>io.seldon.clustermanager</groupId>
<artifactId>seldon-cluster-manager</artifactId>
<packaging>jar</packaging>
<version>0.2.3</version>
<version>0.2.4</version>
<name>seldon-cluster-manager</name>
<url>http://maven.apache.org</url>

Expand Down Expand Up @@ -81,7 +81,7 @@
<dependency>
<groupId>io.kubernetes</groupId>
<artifactId>client-java</artifactId>
<version>1.0.0</version>
<version>3.0.0</version>
<scope>compile</scope>
</dependency>

Expand All @@ -102,6 +102,26 @@
</extensions>

<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.2</version>
<executions>
<execution>
<id>jacoco-initialize</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public class ClusterManagerProperites {
private int engineContainerPort;
private int engineGrpcContainerPort;
private String engineContainerImageAndVersion;
private String engineContainerImagePullPolicy;
private String engineContainerImagePullPolicy = "IfNotPresent";
private String engineContainerServiceAccountName = "default";
private int puContainerPortBase;
private String namespace;

Expand Down Expand Up @@ -59,7 +60,15 @@ public void setEngineContainerImagePullPolicy(String engineContainerImagePullPol
this.engineContainerImagePullPolicy = engineContainerImagePullPolicy;
}

public int getPuContainerPortBase() {
public String getEngineContainerServiceAccountName() {
return engineContainerServiceAccountName;
}

public void setEngineContainerServiceAccountName(String engineContainerServiceAccountName) {
this.engineContainerServiceAccountName = engineContainerServiceAccountName;
}

public int getPuContainerPortBase() {
return puContainerPortBase;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ public class Constants {
public static final String STATE_CREATING = "Creating";
public static final String STATE_FAILED = "Failed";
public static final String STATE_AVAILABLE = "Available";

public static final String ENGINE_JAVA_OPTS_ANNOTATION = "seldon.io/engine-java-opts";
public static final String REST_READ_TIMEOUT_ANNOTATION = "seldon.io/rest-read-timeout";
public static final String GRPC_READ_TIMEOUT_ANNOTATION = "seldon.io/grpc-read-timeout";
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ public int watchDeployments(int resourceVersion,int resourceVersionProcessed) th
// put this logic in new class
}
}

}
}
catch(RuntimeException e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public interface KubeCRDHandler {

public void updateRaw(String json,String seldonDeploymentName);
public void updateSeldonDeployment(SeldonDeployment mlDep);
public void updateSeldonDeploymentStatus(SeldonDeployment mlDep);
public SeldonDeployment getSeldonDeployment(String name);
public ExtensionsV1beta1DeploymentList getOwnedDeployments(String seldonDeploymentName);
public V1ServiceList getOwnedServices(String seldonDeploymentName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public class KubeCRDHandlerImpl implements KubeCRDHandler {

private final String namespace;

private boolean replaceStatusResource = true; // Whether to use the status CR endpoint (available from k8s 1.10 (alpha) 1.11 (beta)

@Autowired
public KubeCRDHandlerImpl(ClusterManagerProperites clusterManagerProperites) {
this.namespace = StringUtils.isEmpty(clusterManagerProperites.getNamespace()) ? "default" : clusterManagerProperites.getNamespace();
Expand All @@ -75,9 +77,9 @@ public void updateRaw(String json,String seldonDeploymentName) {


}

@Override
public void updateSeldonDeployment(SeldonDeployment mldep) {
public void updateSeldonDeploymentStatus(SeldonDeployment mldep) {

try
{
Expand All @@ -96,7 +98,18 @@ public void updateSeldonDeployment(SeldonDeployment mldep) {
logger.debug("Updating seldondeployment "+mlDeployment.getMetadata().getName());
ApiClient client = Config.defaultClient();
CustomObjectsApi api = new CustomObjectsApi(client);
api.replaceNamespacedCustomObject(GROUP, VERSION, namespace, KIND_PLURAL, mlDeployment.getMetadata().getName(),json.getBytes());
if (replaceStatusResource)
{
try
{
api.replaceNamespacedCustomObjectStatus(GROUP, VERSION, namespace, KIND_PLURAL, mlDeployment.getMetadata().getName(),json.getBytes());
} catch (ApiException e) {
replaceStatusResource = false; // Stop using the /status endpoint (maybe because the k8s version does not have this <1.10)
logger.warn("Failed to update deployment in kubernetes ",e);
}
}
if (!replaceStatusResource)
api.replaceNamespacedCustomObject(GROUP, VERSION, namespace, KIND_PLURAL, mlDeployment.getMetadata().getName(),json.getBytes());
} catch (InvalidProtocolBufferException e) {
logger.error("Failed to update deployment in kubernetes ",e);
} catch (ApiException e) {
Expand Down
Loading

0 comments on commit ec16b42

Please sign in to comment.