software.cfg 19.8 KB
Newer Older
1 2 3 4 5 6
[buildout]
extends =
   ../../component/nodejs/buildout.cfg
   ../../component/caddy/buildout.cfg
   ../../component/git/buildout.cfg
   ../../component/bash/buildout.cfg
7 8 9 10 11
   ../../component/fish-shell/buildout.cfg
   ../../component/tmux/buildout.cfg
   ../../component/tig/buildout.cfg
   ../../component/vim/buildout.cfg
   ../../component/curl/buildout.cfg
12
   ../../component/coreutils/buildout.cfg
13
   ../../component/java-jdk/buildout.cfg
14
   ../../stack/slapos.cfg
15
   ../../stack/monitor/buildout.cfg
16
   ../../component/defaults.cfg
17 18 19 20 21 22 23
   ./buildout.hash.cfg

parts =
  theia-wrapper
  slapos-cookbook
  instance

24 25 26
# default for slapos-standalone
shared-part-list =

27 28 29 30 31
# 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

32 33

[nodejs]
34
<= nodejs-12.18.3
35 36 37 38 39

[yarn]
# this could become a component, but it needs to be invoked from nodejs explicitly,
# otherwise it uses system's nodejs
# XXX why don't we build a wrapper ?
40
version = 1.17.3
41 42
recipe = slapos.recipe.build:download-unpacked
url = https://github.com/yarnpkg/yarn/releases/download/v${:version}/yarn-v${:version}.tar.gz
43
md5sum = 4a02e1687a150113ad6b0215f9afdb3e
44

45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
[slapos-standalone]
recipe = zc.recipe.egg
eggs =
  slapos.core
scripts = ${:_buildout_section_name_}
script-path = ${buildout:bin-directory}/${:scripts}
# XXX generate a fake entry point for a non existant module, that will not
# be used because we exit in initialization step
entry-points =
  ${:scripts}=not_used:main
initialization =
  import argparse
  import os.path
  import sys
  import glob

  import slapos.slap.standalone

  parser = argparse.ArgumentParser()
  parser.add_argument('base_directory')
  parser.add_argument('ipv4')
  parser.add_argument('ipv6')
  parser.add_argument('server_port', type=int)
68 69 70 71 72 73 74
  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')
75 76
  args = parser.parse_args()
  shared_part_list = [x.strip() for x in '''${buildout:shared-part-list}'''.splitlines() if x.strip()]
77 78 79 80 81 82 83 84 85 86 87 88
  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',
          ),
      ),
  )
89 90 91 92
  standalone = slapos.slap.standalone.StandaloneSlapOS(
      args.base_directory,
      args.ipv4,
      args.server_port,
93 94
      shared_part_list=shared_part_list,
      partition_forward_configuration=partition_forward_configuration,
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
  )
  standalone.start()
  partition_count = 20
  if len(glob.glob(os.path.join(standalone.instance_directory, '*'))) < partition_count:
    print("Standalone SlapOS: Formatting {partition_count} partitions".format(
        partition_count=partition_count))
    standalone.format(
        partition_count,
        args.ipv4,
        args.ipv6
    )
  print ("Standalone SlapOS for computer `{}` activated".format(standalone.computer._computer_id))
  sys.exit(0)

needs-these-eggs-scripts-in-path =
  ${supervisor:recipe}
  ${slapos-command:recipe}

[supervisor]
recipe = zc.recipe.egg
eggs =
  supervisor
  setuptools
118 119 120 121 122

[python-language-server]
version = 0.19.0
recipe = plone.recipe.command
command =
123
  PATH=${git:location}/bin/:$PATH  bash -c "${python3:executable} -m venv ${:location} && \
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
    . ${:location}/bin/activate && \
    pip install -r ${python-language-server-requirements.txt:output}"
location = ${buildout:parts-directory}/${:_buildout_section_name_}
stop-on-error = true

[python-language-server-requirements.txt]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:parts-directory}/${:_buildout_section_name_}
mode = 0644


[theia]
recipe = plone.recipe.command
command = ${bash:location}/bin/bash -c "
139
  export TMPDIR=${:location}/tmp PATH=${nodejs:location}/bin:$PATH &&
140
  mkdir -p ${:location} && \
141
  mkdir -p \$TMPDIR && \
142
  mkdir -p ${:THEIA_DEFAULT_PLUGINS} && \
143 144 145 146
  cd ${:location} && \
  cp ${package.json:rendered} . &&
  cp ${yarn.lock:output} . &&
  ${yarn:location}/bin/yarn && \
147 148
  ${yarn:location}/bin/yarn theia build && \
  ${yarn:location}/bin/yarn theia download:plugins"
149 150
location = ${buildout:parts-directory}/${:_buildout_section_name_}
stop-on-error = true
151
uses = ${yarn.lock:recipe}
152
THEIA_DEFAULT_PLUGINS = ${:location}/plugins/
153 154 155 156 157 158 159 160 161

[yarn.lock]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:parts-directory}/${:_buildout_section_name_}
mode = 0644

[package.json]
recipe = slapos.recipe.template:jinja2
162
# this comes from https://github.com/theia-ide/theia-apps/blob/a54aaa676e3db07d22ab75dde9f3447576135b4d/theia-full-docker/latest.package.json
163
# but with a more recent version of vscode-java-redhat, where https://github.com/redhat-developer/vscode-java/issues/1301 was fixed
164
template =
165
  inline:{
166 167 168 169 170 171
      "private": true,
      "theia": {
          "frontend": {
              "config": {
                  "applicationName": "Theia SlapOS",
                  "preferences": {
172
                      "application.confirmExit": "always",
173 174 175 176 177 178
                      "files.enableTrash": false,
                      "files.exclude": {
                          "**.pyc": true,
                          "**.egg-info": true,
                          "__pycache__": true,
                          ".git": true,
179 180
                          ".env": true,
                          "**/node_modules/**": true
181 182
                      },
                      "files.watcherExclude": {
183 184 185 186
                          "**/.eggs/**": true,
                          "**/.env/**": true,
                          "**/.git/**": true,
                          "**/node_modules/**": true
187 188
                      },
                      "editor.multiCursorModifier": "ctrlCmd",
189
                      "editor.tabSize": 2,
190 191
                      "plantuml.server": "https://plantuml.host.vifib.net/svg/",
                      "plantuml.render": "PlantUMLServer",
192 193
                      "gitlens.remotes": [{ "domain": "lab.nexedi.com", "type": "GitLab" }],
                      "java.home": "${java-jdk:location}"
194 195 196 197 198
                  }
              }
          }
      },
      "dependencies": {
199
          "@theia/callhierarchy": "latest",
200
          "@theia/console": "latest",
201
          "@theia/core": "latest",
202
          "@theia/cpp-debug": "latest",
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224
          "@theia/debug": "latest",
          "@theia/editor": "latest",
          "@theia/editor-preview": "latest",
          "@theia/file-search": "latest",
          "@theia/filesystem": "latest",
          "@theia/getting-started": "latest",
          "@theia/git": "latest",
          "@theia/keymaps": "latest",
          "@theia/markers": "latest",
          "@theia/messages": "latest",
          "@theia/metrics": "latest",
          "@theia/mini-browser": "latest",
          "@theia/monaco": "latest",
          "@theia/navigator": "latest",
          "@theia/outline-view": "latest",
          "@theia/output": "latest",
          "@theia/plugin": "latest",
          "@theia/plugin-ext": "latest",
          "@theia/plugin-ext-vscode": "latest",
          "@theia/preferences": "latest",
          "@theia/preview": "latest",
          "@theia/process": "latest",
225
          "@theia/scm": "latest",
226 227 228
          "@theia/search-in-workspace": "latest",
          "@theia/task": "latest",
          "@theia/terminal": "latest",
229
          "@theia/typehierarchy": "latest",
230 231
          "@theia/userstorage": "latest",
          "@theia/variable-resolver": "latest",
232
          "@theia/vsx-registry": "latest",
233
          "@theia/workspace": "latest",
234
          "@perrinjerome/theia-open": "0.1.2"
235 236
      },
      "devDependencies": {
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
          "@theia/cli": "latest"
      },
      "theiaPluginsDir": "plugins",
      "theiaPlugins": {
          "vscode-builtin-bat": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/bat-1.39.1-prel.vsix",
          "vscode-builtin-clojure": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/clojure-1.39.1-prel.vsix",
          "vscode-builtin-coffeescript": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/coffeescript-1.39.1-prel.vsix",
          "vscode-builtin-configuration-editing": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/configuration-editing-1.39.1-prel.vsix",
          "vscode-builtin-cpp": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/cpp-1.39.1-prel.vsix",
          "vscode-builtin-csharp": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/csharp-1.39.1-prel.vsix",
          "vscode-builtin-css": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/css-1.39.1-prel.vsix",
          "vscode-builtin-debug-auto-launch": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/debug-auto-launch-1.39.1-prel.vsix",
          "vscode-builtin-docker": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/docker-1.39.1-prel.vsix",
          "vscode-builtin-emmet": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/emmet-1.39.1-prel.vsix",
          "vscode-builtin-fsharp": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/fsharp-1.39.1-prel.vsix",
          "vscode-builtin-go": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/go-1.39.1-prel.vsix",
          "vscode-builtin-groovy": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/groovy-1.39.1-prel.vsix",
          "vscode-builtin-grunt": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/grunt-1.39.1-prel.vsix",
          "vscode-builtin-gulp": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/gulp-1.39.1-prel.vsix",
          "vscode-builtin-handlebars": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/handlebars-1.39.1-prel.vsix",
          "vscode-builtin-hlsl": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/hlsl-1.39.1-prel.vsix",
          "vscode-builtin-html": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/html-1.39.1-prel.vsix",
          "vscode-builtin-ini": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/ini-1.39.1-prel.vsix",
          "vscode-builtin-jake": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/jake-1.39.1-prel.vsix",
          "vscode-builtin-java": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/java-1.39.1-prel.vsix",
          "vscode-builtin-javascript": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/javascript-1.39.1-prel.vsix",
          "vscode-builtin-json": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/json-1.39.1-prel.vsix",
264
          "vscode-builtin-json-language-features": "https://open-vsx.org/api/vscode/json-language-features/1.46.1/file/vscode.json-language-features-1.46.1.vsix",
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
          "vscode-builtin-less": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/less-1.39.1-prel.vsix",
          "vscode-builtin-log": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/log-1.39.1-prel.vsix",
          "vscode-builtin-lua": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/lua-1.39.1-prel.vsix",
          "vscode-builtin-make": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/make-1.39.1-prel.vsix",
          "vscode-builtin-markdown": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/markdown-1.39.1-prel.vsix",
          "vscode-builtin-merge-conflicts": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/merge-conflict-1.39.1-prel.vsix",
          "vscode-builtin-npm": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/npm-1.39.1-prel.vsix",
          "vscode-builtin-node-debug": "https://github.com/theia-ide/vscode-node-debug/releases/download/v1.35.3/node-debug-1.35.3.vsix",
          "vscode-builtin-node-debug2": "https://github.com/theia-ide/vscode-node-debug2/releases/download/v1.33.0/node-debug2-1.33.0.vsix",
          "vscode-builtin-objective-c": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/objective-c-1.39.1-prel.vsix",
          "vscode-builtin-perl": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/perl-1.39.1-prel.vsix",
          "vscode-builtin-powershell": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/powershell-1.39.1-prel.vsix",
          "vscode-builtin-pug": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/pug-1.39.1-prel.vsix",
          "vscode-builtin-python": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/python-1.39.1-prel.vsix",
          "vscode-builtin-r": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/r-1.39.1-prel.vsix",
          "vscode-builtin-razor": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/razor-1.39.1-prel.vsix",
          "vscode-builtin-ruby": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/ruby-1.39.1-prel.vsix",
          "vscode-builtin-rust": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/rust-1.39.1-prel.vsix",
          "vscode-builtin-scss": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/scss-1.39.1-prel.vsix",
          "vscode-builtin-shaderlab": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/shaderlab-1.39.1-prel.vsix",
          "vscode-builtin-shellscript": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/shellscript-1.39.1-prel.vsix",
          "vscode-builtin-sql": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/sql-1.39.1-prel.vsix",
          "vscode-builtin-swift": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/swift-1.39.1-prel.vsix",
          "vscode-builtin-theme-abyss": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/theme-abyss-1.39.1-prel.vsix",
          "vscode-builtin-theme-defaults": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/theme-defaults-1.39.1-prel.vsix",
          "vscode-builtin-theme-kimbie-dark": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/theme-kimbie-dark-1.39.1-prel.vsix",
          "vscode-builtin-theme-monokai": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/theme-monokai-1.39.1-prel.vsix",
          "vscode-builtin-theme-dimmed": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/theme-monokai-dimmed-1.39.1-prel.vsix",
          "vscode-builtin-theme-quietlight": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/theme-quietlight-1.39.1-prel.vsix",
          "vscode-builtin-theme-red": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/theme-red-1.39.1-prel.vsix",
          "vscode-builtin-theme-solarized-dark": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/theme-solarized-dark-1.39.1-prel.vsix",
          "vscode-builtin-theme-tomorrow-night-blue": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/theme-tomorrow-night-blue-1.39.1-prel.vsix",
          "vscode-builtin-typescript": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/typescript-1.39.1-prel.vsix",
          "vscode-builtin-typescript-language-features": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/typescript-language-features-1.39.1-prel.vsix",
          "vscode-builtin-vb": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/vb-1.39.1-prel.vsix",
          "vscode-builtin-icon-theme-seti": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/vscode-theme-seti-1.39.1-prel.vsix",
          "vscode-builtin-xml": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/xml-1.39.1-prel.vsix",
          "vscode-builtin-yaml": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/yaml-1.39.1-prel.vsix",
          "vscode-editorconfig": "https://github.com/theia-ide/editorconfig-vscode/releases/download/v0.14.4/EditorConfig-0.14.4.vsix",
          "vscode-eslint": "https://github.com/theia-ide/vscode-eslint/releases/download/release%2F2.0.15/vscode-eslint-2.0.15.vsix",
          "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",
308
          "vscode-java-redhat": "https://github.com/redhat-developer/vscode-java/releases/download/v0.61.0/redhat.java-0.61.0.vsix",
309
          "vscode-java-test": "https://github.com/microsoft/vscode-java-test/releases/download/0.22.0/vscjava.vscode-java-test-0.22.0.vsix",
310
          "vscode-python": "https://github.com/microsoft/vscode-python/releases/download/2020.1.58038/ms-python-release.vsix",
311
          "vscode-ruby": "https://github.com/rubyide/vscode-ruby/releases/download/v0.25.0/ruby-0.25.0.vsix",
312 313
          "vscode-zc-buildout": "https://github.com/perrinjerome/vscode-zc-buildout/releases/download/v0.2.0/vscode-zc-buildout-0.2.0.vsix",
          "plantuml": "https://open-vsx.org/api/jebbs/plantuml/2.13.12/file/jebbs.plantuml-2.13.12.vsix"
314
      }
315
    }
316 317 318 319 320
rendered = ${buildout:directory}/${:_buildout_section_name_}
mode = 0644


[gowork]
321 322 323 324 325 326
golang = ${golang1.14:location}

[gowork.goinstall]
command =
  bash -c ". ${gowork:env.sh} && GO111MODULE=on go get golang.org/x/tools/gopls@v0.4.3"

327

328
[cli-utilities]
329
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/
330 331 332 333 334 335 336 337 338

[theia-wrapper]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:bin-directory}/${:_buildout_section_name_}
mode = 0777
template =
  inline:
  #!/bin/bash
  . ${gowork:env.sh}
339
  export PATH=${python-language-server:location}/bin/:${java-jdk:location}/bin/:${cli-utilities:PATH}:$HOME/.cargo/bin:$PATH
340
  export THEIA_DEFAULT_PLUGINS="local-dir:${theia:THEIA_DEFAULT_PLUGINS}"
Jérome Perrin's avatar
Jérome Perrin committed
341 342
  # reset PS1 from gowork
  export PS1='$ '
343 344 345 346 347 348 349 350 351 352 353
  cd ${theia:location}
  exec ${yarn:location}/bin/yarn theia start $@


[instance]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
mode = 0644
output = ${buildout:directory}/instance.cfg

[versions]
354
slapos.recipe.template = 4.4