Skip to content
Merged
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: 5 additions & 4 deletions deploy/kubernetes/kubectl/wsnext/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@

Execute
```shell
docker build --no-cache -t garagatyi/che-marketplace:1 .
docker build --no-cache -t garagatyi/che-marketplace:os .
```
Where `--no-cache` is needed to prevent usage of cached layers with marketplace files.
Useful when you change marketplace files and rebuild the image.

`-t garagatyi/che-marketplace:1` is needed to set identifier of the image. Do not forget to change `feature-api/yaml` file accordingly if you change this identifier to something else.
`-t garagatyi/che-marketplace:os` is needed to set identifier of the image.
Do not forget to change `feature-api.yaml` file accordingly if you change this identifier to something else.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we have editor and plugins. Maybe we should rename feature-api.yaml to something different. Because we don't have features anymore.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to change it because there is fresh blog post from Mario that uses instructions where this name is used.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oook. however, it looks weird. For how long are you going to keep it in this way?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. Is it important to you?


## Use custome repository as a source of marketplace files

To use a custom git repo as a source of marketplace files use next command to build the image:
```shell
docker build --no-cache -t garagatyi/che-marketplace:1 --build-arg STORAGE_REPO=https://github.com/someuser/somerepo .
docker build --no-cache -t garagatyi/che-marketplace:os --build-arg STORAGE_REPO=https://github.com/someuser/somerepo .
```

## Use local path as a source of marketplace files

To use local path as a source of marketplace files use next command to build the image:
```shell
docker build --no-cache -t garagatyi/che-marketplace:1 --build-arg STORAGE_TYPE=path --build-arg STORAGE_PATH=some_path_in_build_context path_to_build_context
docker build --no-cache -t garagatyi/che-marketplace:os --build-arg STORAGE_TYPE=path --build-arg STORAGE_PATH=some_path_in_build_context path_to_build_context
```
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,23 @@
*/
package org.eclipse.che.api.workspace.server.wsnext.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/** Represents sidecar container in Che workspace. */
public class CheContainer {

private String image = null;
private List<EnvVar> env = new ArrayList<>();

@JsonProperty("editor-commands")
private List<Command> commands = new ArrayList<>();

private List<Volume> volumes = new ArrayList<>();
private List<CheContainerPort> ports = new ArrayList<>();

/** */
public CheContainer image(String image) {
this.image = image;
return this;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright (c) 2012-2018 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*/
package org.eclipse.che.api.workspace.server.wsnext.model;

/**
* Represents an editor inside of Che workspace.
*
* <p>It may be classic GWT IDE, Eclipse Theia or something else.
*/
public class CheEditor extends PluginBase {

This comment was marked as resolved.

This comment was marked as resolved.

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof CheEditor)) {
return false;
}
CheEditor cheEditor = (CheEditor) o;
return super.equals(cheEditor);
}

@Override
public int hashCode() {
return super.hashCode();
}

@Override
public String toString() {
return "CheEditor{"
+ "name='"
+ getName()
+ '\''
+ ", id='"
+ getId()
+ '\''
+ ", version='"
+ getVersion()
+ '\''
+ ", containers="
+ getContainers()
+ ", endpoints="
+ getEndpoints()
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,78 +14,21 @@
import java.util.List;
import java.util.Objects;

public class ChePlugin {
/** Represents Che plugin in sidecar-powered workspace. */
public class ChePlugin extends PluginBase {
private List<EditorCompatibility> editors = new ArrayList<>();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that I fully understand all last changes in WsNext Skeleton, and it's just a note to consider: in editors field I would expect to see a list of CheEditors objects, or list of CheEditors identifiers.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

editor field contains a list of editors supported by a plugin with identifiers in a field name and other plugins that needed for correct integration of the editor and the plugin in a field plugins. All of that is incorporated in EditorCompatibility object in this PR.
Does this clarify the idea to you?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, thanks for the explanation.

Does it mean that different CheEditors can be used at the same time? It's OK just to clarify.

As far as I understand ChePlugin depends on EditorCompatibilitys, EditorCompatibility depends on ChePlugins. Are circular dependencies are handled correctly?

Copy link
Copy Markdown
Author

@garagatyi garagatyi Jul 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ChePlugin shows that different plugins might be used with it, but Che should ensure that just one is in use.
Circular dependencies are not handled because compatibility is not implemented and I'm not sure we need this verification on this step where parts are still moving rapidly and things that are here now might be gone tomorrow.


private String name = null;
private String id = null;
private String version = null;
private List<CheContainer> containers = new ArrayList<>();
private List<ChePluginEndpoint> endpoints = new ArrayList<>();

/** Object name. Name must be unique. */
public ChePlugin name(String name) {
this.name = name;
return this;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public ChePlugin id(String id) {
this.id = id;
return this;
}

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public ChePlugin version(String version) {
this.version = version;
return this;
}

public String getVersion() {
return version;
}

public void setVersion(String version) {
this.version = version;
}

public ChePlugin containers(List<CheContainer> containers) {
this.containers = containers;
return this;
}

public List<CheContainer> getContainers() {
return containers;
}

public void setContainers(List<CheContainer> containers) {
this.containers = containers;
}

public ChePlugin endpoints(List<ChePluginEndpoint> endpoints) {
this.endpoints = endpoints;
public ChePlugin editors(List<EditorCompatibility> editors) {
this.editors = editors;
return this;
}

public List<ChePluginEndpoint> getEndpoints() {
return endpoints;
public List<EditorCompatibility> getEditors() {
return editors;
}

public void setEndpoints(List<ChePluginEndpoint> endpoints) {
this.endpoints = endpoints;
public void setEditors(List<EditorCompatibility> editors) {
this.editors = editors;
}

@Override
Expand All @@ -96,37 +39,36 @@ public boolean equals(Object o) {
if (!(o instanceof ChePlugin)) {
return false;
}
ChePlugin chePlugin = (ChePlugin) o;
return Objects.equals(getName(), chePlugin.getName())
&& Objects.equals(getId(), chePlugin.getId())
&& Objects.equals(getVersion(), chePlugin.getVersion())
&& Objects.equals(getContainers(), chePlugin.getContainers())
&& Objects.equals(getEndpoints(), chePlugin.getEndpoints());
if (!super.equals(o)) {
return false;
}
ChePlugin plugin = (ChePlugin) o;
return Objects.equals(getEditors(), plugin.getEditors());
}

@Override
public int hashCode() {

return Objects.hash(
super.hashCode(), getName(), getId(), getVersion(), getContainers(), getEndpoints());
return Objects.hash(super.hashCode(), getEditors());
}

@Override
public String toString() {
return "ChePlugin{"
+ "name='"
+ name
+ getName()
+ '\''
+ ", id='"
+ id
+ getId()
+ '\''
+ ", version='"
+ version
+ getVersion()
+ '\''
+ ", containers="
+ containers
+ getContainers()
+ ", endpoints="
+ endpoints
+ getEndpoints()
+ ", editors="
+ getEditors()
+ '}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* Copyright (c) 2012-2018 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*/
package org.eclipse.che.api.workspace.server.wsnext.model;

import java.util.List;
import java.util.Objects;

/** Specifies compatibility with a specific Che editor and plugins needed for the compatibility. */
public class EditorCompatibility {
private String name;
private List<String> plugins;

public String getName() {
return name;
}

public EditorCompatibility name(String name) {
this.name = name;
return this;
}

public void setName(String name) {
this.name = name;
}

public EditorCompatibility plugins(List<String> plugins) {
this.plugins = plugins;
return this;
}

public List<String> getPlugins() {
return plugins;
}

public void setPlugins(List<String> plugins) {
this.plugins = plugins;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof EditorCompatibility)) {
return false;
}
EditorCompatibility that = (EditorCompatibility) o;
return Objects.equals(getName(), that.getName())
&& Objects.equals(getPlugins(), that.getPlugins());
}

@Override
public int hashCode() {
return Objects.hash(getName(), getPlugins());
}

@Override
public String toString() {
return "EditorCompatibility{" + "name='" + name + '\'' + ", plugins=" + plugins + '}';
}
}
Loading