Skip to content

Commit

Permalink
Fix vscode monitor demo
Browse files Browse the repository at this point in the history
Built-in plugins now need to be extracted in the plugins folder.
Fix small typo.
Make AbstractTheiaCloudOperatorLauncher an interface and rename it.
  • Loading branch information
sgraband committed May 22, 2024
1 parent 84c376e commit 9336190
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
9 changes: 8 additions & 1 deletion demo/dockerfiles/demo-theia-monitor-vscode/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
FROM node:18-bullseye-slim as build-stage

# Copy and unzip the vsix file
RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/*
COPY theiacloud-monitor-0.11.0-next.vsix /tmp/theiacloud-monitor.vsix
RUN mkdir /tmp/extracted && unzip /tmp/theiacloud-monitor.vsix -d /tmp/extracted

FROM theiacloud/theia-cloud-demo:0.11.0-next as production-stage

COPY --chown=theia:theia theiacloud-monitor-0.11.0-next.vsix /home/theia/plugins
COPY --chown=theia:theia --from=build-stage /tmp/extracted /home/theia/plugins
Binary file not shown.
2 changes: 1 addition & 1 deletion documentation/Architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The Theia Cloud Operator listens for changes to custom resources inside the clus

The Java operator is created via a dependency injection module.
We provide a library (`org.eclipse.theia.cloud.operator`), as well as a default implementation (`org.eclipse.theia.cloud.defaultoperator`) for the operator.
The library can be used to create a operator customized to your use cases.
The library can be used to create an operator customized to your use cases.
The default implementation is a production-ready operator that handles most use cases on most cloud providers out of the box and is used in our demos.
If customization is needed, it also serves as an example of how to utilize the operator library.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.eclipse.theia.cloud.operator.TheiaCloudOperator;
import org.eclipse.theia.cloud.operator.AbstractTheiaCloudOperatorLauncher;
import org.eclipse.theia.cloud.operator.TheiaCloudOperatorArguments;
import org.eclipse.theia.cloud.operator.TheiaCloudOperatorLauncher;
import org.eclipse.theia.cloud.operator.di.AbstractTheiaCloudOperatorModule;

import com.google.inject.Guice;
Expand All @@ -41,7 +41,7 @@
import io.fabric8.kubernetes.client.extended.leaderelection.resourcelock.LeaseLock;
import picocli.CommandLine;

public class DefaultTheiaCloudOperatorLauncher extends AbstractTheiaCloudOperatorLauncher {
public class DefaultTheiaCloudOperatorLauncher implements TheiaCloudOperatorLauncher {

private static final Logger LOGGER = LogManager.getLogger(DefaultTheiaCloudOperatorLauncher.class);

Expand Down Expand Up @@ -87,7 +87,8 @@ public void runMain(String[] args) throws InterruptedException {

.withLock(new LeaseLock(leaseLockNamespace, LEASE_LOCK_NAME, lockIdentity))//
.withLeaderCallbacks(new LeaderCallbacks(DefaultTheiaCloudOperatorLauncher.this::onStartLeading,
DefaultTheiaCloudOperatorLauncher.this::onStopLeading, DefaultTheiaCloudOperatorLauncher.this::onNewLeader))//
DefaultTheiaCloudOperatorLauncher.this::onStopLeading,
DefaultTheiaCloudOperatorLauncher.this::onNewLeader))//
.build();
LeaderElector leaderElector = k8sClient.leaderElector().withConfig(leaderElectionConfig).build();
leaderElector.run();
Expand Down Expand Up @@ -122,7 +123,7 @@ protected void startOperatorAsLeader(TheiaCloudOperatorArguments arguments) {
}

@Override
protected TheiaCloudOperatorArguments createArguments(String[] args) {
public TheiaCloudOperatorArguments createArguments(String[] args) {
TheiaCloudOperatorArguments arguments = new TheiaCloudOperatorArguments();
CommandLine commandLine = new CommandLine(arguments).setTrimQuotes(true);
commandLine.parseArgs(args);
Expand All @@ -131,7 +132,7 @@ protected TheiaCloudOperatorArguments createArguments(String[] args) {
}

@Override
protected AbstractTheiaCloudOperatorModule createModule(TheiaCloudOperatorArguments arguments) {
public AbstractTheiaCloudOperatorModule createModule(TheiaCloudOperatorArguments arguments) {
return new DefaultTheiaCloudOperatorModule(arguments);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

import org.eclipse.theia.cloud.operator.di.AbstractTheiaCloudOperatorModule;

public abstract class AbstractTheiaCloudOperatorLauncher {
public interface TheiaCloudOperatorLauncher {

public abstract void runMain(String[] args) throws InterruptedException;

protected abstract TheiaCloudOperatorArguments createArguments(String[] args);
public abstract TheiaCloudOperatorArguments createArguments(String[] args);

protected abstract AbstractTheiaCloudOperatorModule createModule(TheiaCloudOperatorArguments arguments);
public abstract AbstractTheiaCloudOperatorModule createModule(TheiaCloudOperatorArguments arguments);

}

0 comments on commit 9336190

Please sign in to comment.