Commit 00fcd8ea authored by Jérome Perrin's avatar Jérome Perrin

theia version up

version up to current version (0.13.0) and include configuration to make use of nexedi/slapos.core!218

Also switch to gopls and include jdk, with all preliminary support for patchelf.

See merge request nexedi/slapos!774
parents 0c93b19c 16d9b557
......@@ -64,7 +64,7 @@ environment-extra =
url = https://dl.google.com/go/go1.12.9.src.tar.gz
md5sum = 6132109d4050da349eadc9f7b0304ef4
# go1.11 needs go1.4 to bootstrap
# go1.12 needs go1.4 to bootstrap
environment-extra =
GOROOT_BOOTSTRAP=${golang14:location}
......@@ -77,6 +77,15 @@ md5sum = 4ad8b04f962be93a32f3021e6f35b3b9
environment-extra =
GOROOT_BOOTSTRAP=${golang14:location}
[golang1.14]
<= golang-common
url = https://dl.google.com/go/go1.14.3.src.tar.gz
md5sum = 6b1fb42d219e2ea8925002013c76d4c7
# go1.14 needs go1.4 to bootstrap
environment-extra =
GOROOT_BOOTSTRAP=${golang14:location}
# ---- infrastructure to build Go workspaces / projects ----
# gowork is a top-level section representing workspace
......
[buildout]
extends =
../patchelf/buildout.cfg
../zlib/buildout.cfg
parts =
java-jdk
[java-jdk]
recipe = plone.recipe.command
command = echo "Error: unsupported platform" && false
stop-on-error = true
location =
[java-jdk:linux and bits64]
recipe = slapos.recipe.cmmi
shared = true
url = https://download.java.net/java/GA/jdk12.0.2/e482c34c86bd4bf8b56c0b35558996b9/10/GPL/openjdk-12.0.2_linux-x64_bin.tar.gz
md5sum = f5da6f4dec81bdd2a096184ec1d69216
configure-command = :
make-binary = :
pre-install =
mkdir -p @@LOCATION@@
cp -r * @@LOCATION@@
post-install =
for file in @@LOCATION@@/bin/* ; do
echo appending rpath to $file
${patchelf:location}/bin/patchelf --set-rpath ${:rpath} $file
done
rpath = ${zlib:location}/lib:@@LOCATION@@/lib
location = @@LOCATION@@
[buildout]
extends =
../autoconf/buildout.cfg
../automake/buildout.cfg
../pkgconfig/buildout.cfg
parts =
patchelf
[patchelf]
recipe = slapos.recipe.cmmi
shared = true
url = https://github.com/NixOS/patchelf/archive/0.11.tar.gz
md5sum = 6cffb77ee7a95bd314d954a6aeb53a02
pre-configure =
autoreconf -vif
environment =
PATH=${pkgconfig:location}/bin:${autoconf:location}/bin:${automake:location}/bin:%(PATH)s
......@@ -15,11 +15,11 @@
[instance]
filename = instance.cfg.in
md5sum = 42d21dc3f5d3e57e142eea8e016195f0
md5sum = d8ad39bc93c492026a93c28b33a5dc3a
[yarn.lock]
filename = yarn.lock
md5sum = ae1b596804715acd3512f1e8e6cbae3b
md5sum = 89d0a4d0c3ae90b9c5c0923b57766f0f
[python-language-server-requirements.txt]
filename = python-language-server-requirements.txt
......
This diff is collapsed.
......@@ -121,7 +121,7 @@ recipe = slapos.cookbook:userinfo
recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:services}/$${:_buildout_section_name_}
command-line =
env LC_ALL=C.UTF-8 TMP=$${directory:tmp} THEIA_WEBVIEW_EXTERNAL_ENDPOINT='{{hostname}}' THEIA_SHELL=$${theia-shell:wrapper-path} ${theia-wrapper:rendered} --hostname=$${:hostname} --port=$${:port} $${directory:project}
env LC_ALL=C.UTF-8 TMP=$${directory:tmp} THEIA_WEBVIEW_EXTERNAL_ENDPOINT='{{hostname}}' THEIA_SHELL=$${theia-shell:rendered} ${theia-wrapper:rendered} --hostname=$${:hostname} --port=$${:port} $${directory:project}
ip = $${instance-parameter:ipv4-random}
hostname = $${:ip}
......@@ -132,12 +132,18 @@ hash-existing-files =
${theia-wrapper:rendered}
[theia-shell]
recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:bin}/$${:_buildout_section_name_}
# reset GIT_EXEC_PATH to workaround https://github.com/eclipse-theia/theia/issues/7555
# activate slapos configuration
command-line =
${bash:location}/bin/bash -c ". $${slapos-standalone-activate:rendered} && exec env GIT_EXEC_PATH= ${bash:location}/bin/bash"
recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/$${:_buildout_section_name_}
mode = 0700
template = inline:
#!${python:location}/bin/python
import sys
import os
args = sys.argv[1:]
# when running interactively, activate slapos configuration and reset GIT_EXEC_PATH to workaround https://github.com/eclipse-theia/theia/issues/7555
if not args: args = ["-c", ". $${slapos-standalone-activate:rendered} && exec env GIT_EXEC_PATH= ${bash:location}/bin/bash", ]
os.execv('${bash:location}/bin/bash', ['${bash:location}/bin/bash'] + args)
[slapos-standalone-activate]
recipe = slapos.recipe.template:jinja2
......@@ -147,7 +153,16 @@ mode = 0700
template =
inline:#!/bin/sh
export PATH=${buildout:bin-directory}:$PATH
${slapos-standalone:script-path} $${directory:slapos} $${:ipv4} $${:ipv6} $${:port}
${slapos-standalone:script-path} \
$${directory:slapos} \
$${:ipv4} \
$${:ipv6} \
$${:port} \
$${slap-connection:server-url} \
$${slap-connection:computer-id} \
$${slap-connection:partition-id} \
--key='$${slap-connection:key-file}' \
--cert='$${slap-connection:cert-file}'
export SLAPOS_CONFIGURATION=$${directory:slapos}/etc/slapos.cfg
export SLAPOS_CLIENT_CONFIGURATION=$SLAPOS_CONFIGURATION
......
......@@ -10,15 +10,11 @@ extends =
../../component/vim/buildout.cfg
../../component/curl/buildout.cfg
../../component/coreutils/buildout.cfg
../../component/java-jdk/buildout.cfg
../../stack/slapos.cfg
../../stack/monitor/buildout.cfg
./gowork.cfg
../../component/defaults.cfg
./buildout.hash.cfg
# this gowork.cfg includes the one from caddy, because they share the only gowork
# workspace (not intentionnaly, as far as I see there's only one gowork per SR)
# it is included after caddy, otherwise only caddy is installed. The problem of this
# approach is that caddy's version will be the one pinned here, so we have to update
# here as well.
parts =
theia-wrapper
......@@ -28,6 +24,11 @@ parts =
# default for slapos-standalone
shared-part-list =
# We keep the gcc part in sync with the one from erp5 software, so that when we install
# erp5 inside theia's slapos parts can be shared.
[gcc]
max_version = 0
[nodejs]
<= nodejs-10.19.0
......@@ -64,14 +65,33 @@ initialization =
parser.add_argument('ipv4')
parser.add_argument('ipv6')
parser.add_argument('server_port', type=int)
forwarded_arguments = parser.add_argument_group('forwarded')
forwarded_arguments.add_argument('master_url')
forwarded_arguments.add_argument('computer')
forwarded_arguments.add_argument('partition')
# cert and key are optional
forwarded_arguments.add_argument('--cert')
forwarded_arguments.add_argument('--key')
args = parser.parse_args()
shared_part_list = [x.strip() for x in '''${buildout:shared-part-list}'''.splitlines() if x.strip()]
partition_forward_configuration = (
slapos.slap.standalone.PartitionForwardAsPartitionConfiguration(
master_url=args.master_url,
computer=args.computer,
partition=args.partition,
cert=args.cert,
key=args.key,
software_release_list=(
'http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg',
),
),
)
standalone = slapos.slap.standalone.StandaloneSlapOS(
args.base_directory,
args.ipv4,
args.server_port,
shared_part_list=shared_part_list
shared_part_list=shared_part_list,
partition_forward_configuration=partition_forward_configuration,
)
standalone.start()
partition_count = 20
......@@ -139,7 +159,8 @@ mode = 0644
[package.json]
recipe = slapos.recipe.template:jinja2
# this comes from https://github.com/theia-ide/theia-apps/blob/2991e3a433f031b22bc80e274f80620d1e6898e5/theia-full-docker/latest.package.json
# this comes from https://github.com/theia-ide/theia-apps/blob/3391dd07cba7ddc5cc833420349a27beb66a5433/theia-full-docker/latest.package.json
# but with a more recent version of vscode-java-redhat, where https://github.com/redhat-developer/vscode-java/issues/1301 was fixed
template =
inline:{
"private": true,
......@@ -163,17 +184,20 @@ template =
"**/node_modules/**": true
},
"editor.multiCursorModifier": "ctrlCmd",
"plantuml.webservice": "//plantuml.host.vifib.net/svg/",
"editor.tabSize": 2,
"plantuml.monochrome": false,
"editor.tabSize": 2
"plantuml.webservice": "//plantuml.host.vifib.net/svg/",
"gitlens.remotes": [{ "domain": "lab.nexedi.com", "type": "GitLab" }],
"java.home": "${java-jdk:location}"
}
}
}
},
"dependencies": {
"@theia/callhierarchy": "latest",
"@theia/console": "latest",
"@theia/core": "latest",
"@theia/cpp": "latest",
"@theia/cpp-debug": "latest",
"@theia/debug": "latest",
"@theia/editor": "latest",
"@theia/editor-preview": "latest",
......@@ -200,9 +224,11 @@ template =
"@theia/preview": "latest",
"@theia/process": "latest",
"@theia/rust": "latest",
"@theia/scm": "latest",
"@theia/search-in-workspace": "latest",
"@theia/task": "latest",
"@theia/terminal": "latest",
"@theia/typehierarchy": "latest",
"@theia/userstorage": "latest",
"@theia/variable-resolver": "latest",
"@theia/vsx-registry": "latest",
......@@ -211,8 +237,9 @@ template =
"resolutions": {
"vscode-json-languageserver": "1.2.2",
"vscode-languageserver-protocol": "3.15.0-next.9",
"vscode-languageserver-types": "3.15.0-next.4",
"**/vscode-json-languageserver/**/vscode-languageserver": "6.0.0-next.1"
"vscode-languageserver-types": "3.15.0-next.5",
"**/vscode-json-languageserver/**/vscode-languageserver": "6.0.0-next.1",
"**/moment": "2.24.0"
},
"devDependencies": {
"@theia/cli": "latest"
......@@ -285,7 +312,7 @@ template =
"vscode-go": "https://github.com/microsoft/vscode-go/releases/download/0.12.0/Go-0.12.0.vsix",
"vscode-java-debug": "https://github.com/microsoft/vscode-java-debug/releases/download/0.24.0/vscjava.vscode-java-debug-0.24.0.vsix",
"vscode-java-dependency-viewer": "https://github.com/microsoft/vscode-java-dependency/releases/download/0.6.0/vscode-java-dependency-0.6.0.vsix",
"vscode-java-redhat": "https://github.com/redhat-developer/vscode-java/releases/download/v0.54.2/redhat.java-0.54.2.vsix",
"vscode-java-redhat": "https://github.com/redhat-developer/vscode-java/releases/download/v0.61.0/redhat.java-0.61.0.vsix",
"vscode-java-test": "https://github.com/microsoft/vscode-java-test/releases/download/0.22.0/vscjava.vscode-java-test-0.22.0.vsix",
"vscode-python": "https://github.com/microsoft/vscode-python/releases/download/2020.1.58038/ms-python-release.vsix",
"vscode-ruby": "https://github.com/rubyide/vscode-ruby/releases/download/v0.25.0/ruby-0.25.0.vsix",
......@@ -297,29 +324,15 @@ mode = 0644
[gowork]
# Install go-language-server in workspace
# Note that this is the same workspace as caddy.
# install list comes from https://github.com/theia-ide/go-language-server/blob/d259749c8f263c4d845055833b03b1d2dbefa5b3/README.md#prerequisites
install +=
github.com/ramya-rao-a/go-outline
github.com/acroca/go-symbols
github.com/nsf/gocode
github.com/rogpeppe/godef
golang.org/x/tools/cmd/godoc
github.com/zmb3/gogetdoc
golang.org/x/lint/golint
github.com/fatih/gomodifytags
github.com/uudashr/gopkgs/cmd/gopkgs
golang.org/x/tools/cmd/gorename
sourcegraph.com/sqs/goreturns
github.com/cweill/gotests/...
golang.org/x/tools/cmd/guru
github.com/josharian/impl
github.com/haya14busa/goplay/cmd/goplay
github.com/davidrjenni/reftools/cmd/fillstruct
golang = ${golang1.14:location}
[gowork.goinstall]
command =
bash -c ". ${gowork:env.sh} && GO111MODULE=on go get golang.org/x/tools/gopls@v0.4.3"
[cli-utilities]
PATH = ${nodejs:location}/bin/:${bash:location}/bin/:${fish-shell:location}/bin/:${tig:location}/bin/:${vim:location}/bin/:${tmux:location}/bin/:${git:location}/bin/:${curl:location}/bin
PATH = ${nodejs:location}/bin/:${bash:location}/bin/:${fish-shell:location}/bin/:${tig:location}/bin/:${vim:location}/bin/:${tmux:location}/bin/:${git:location}/bin/:${curl:location}/bin:${python2.7:location}/bin/
[theia-wrapper]
recipe = slapos.recipe.template:jinja2
......@@ -329,7 +342,7 @@ template =
inline:
#!/bin/bash
. ${gowork:env.sh}
export PATH=${python-language-server:location}/bin/:${cli-utilities:PATH}:$PATH
export PATH=${python-language-server:location}/bin/:${java-jdk:location}/bin/:${cli-utilities:PATH}:$PATH
export THEIA_DEFAULT_PLUGINS="local-dir:${theia:THEIA_DEFAULT_PLUGINS}"
# reset PS1 from gowork
export PS1='$ '
......
......@@ -29,6 +29,7 @@ from __future__ import unicode_literals
import os
import textwrap
import logging
import subprocess
import tempfile
import time
from six.moves.urllib.parse import urlparse, urljoin
......@@ -89,6 +90,15 @@ class TestTheia(SlapOSInstanceTestCase):
# use a large enough terminal so that slapos proxy show table fit in the screen
process.setwinsize(5000, 5000)
# log process output for debugging
logger = logging.getLogger('theia-shell')
class DebugLogFile:
def write(self, msg):
logger.info("output from theia-shell: %s", msg)
def flush(self):
pass
process.logfile = DebugLogFile()
process.expect_exact('Standalone SlapOS: Formatting 20 partitions')
process.expect_exact('Standalone SlapOS for computer `local` activated')
......@@ -122,3 +132,13 @@ class TestTheia(SlapOSInstanceTestCase):
process.terminate()
process.wait()
def test_theia_shell_execute_tasks(self):
# shell needs to understand -c "comamnd" arguments for theia tasks feature
test_file = '{}/test file'.format(self.computer_partition_root_path)
subprocess.check_call([
'{}/bin/theia-shell'.format(self.computer_partition_root_path),
'-c',
'touch "{}"'.format(test_file)
])
self.assertTrue(os.path.exists(test_file))
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment