pinokiod 3.2.118 → 3.2.120

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -69,8 +69,7 @@ create_default_packages:
69
69
  }
70
70
  let pinned_exists = await this.kernel.exists("bin/miniconda/conda-meta")
71
71
  if (pinned_exists) {
72
- await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), `conda=24.11.1
73
- conda-libmamba-solver=24.11.1`)
72
+ await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), `conda=24.11.1`)
74
73
  // await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), `conda=24.9.0`)
75
74
  // await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), `conda=24.11.2
76
75
  //conda-libmamba-solver=24.11.1`)
@@ -117,8 +116,7 @@ conda-libmamba-solver=24.11.1`)
117
116
  // set pinned
118
117
  let pinned_exists = await this.kernel.exists("bin/miniconda/conda-meta")
119
118
  if (pinned_exists) {
120
- await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), `conda=24.11.1
121
- conda-libmamba-solver=24.11.1`)
119
+ await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), `conda=24.11.1`)
122
120
  // await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), `conda=24.9.0`)
123
121
  // await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), `conda=24.11.2
124
122
  //conda-libmamba-solver=24.11.1`)
@@ -131,6 +129,13 @@ conda-libmamba-solver=24.11.1`)
131
129
  // - defaults
132
130
  //create_default_packages:
133
131
  // - python=3.10`)
132
+
133
+
134
+ // 1. right after installing conda==24.11.1, run conda update --all
135
+ // 2. The pinned file says conda-libmamba-solver=24.11.1
136
+ // 3. so after conda update --all, it should be conda-libmamba-solver=24.11.1
137
+
138
+
134
139
  let cmds = [
135
140
  //"conda clean -y --index-cache",
136
141
  "conda clean -y --all",
@@ -22,6 +22,7 @@ const Torch = require("./torch")
22
22
  const { glob } = require('glob')
23
23
  const fakeUa = require('fake-useragent');
24
24
  const fse = require('fs-extra')
25
+ const semver = require('semver')
25
26
 
26
27
 
27
28
  //const Puppet = require("./puppeteer")
@@ -276,6 +277,9 @@ class Bin {
276
277
  conda_check.conda = true
277
278
  }
278
279
  }
280
+
281
+ // check conda-libmamba-solver is up to date
282
+ // sometimes it just fails silently so need to check
279
283
  if (name === "conda-libmamba-solver") {
280
284
  //if (String(version) === "24.7.0") {
281
285
  let channel = chunks[3]
@@ -284,6 +288,20 @@ class Bin {
284
288
  conda_check.mamba = true
285
289
  }
286
290
  }
291
+
292
+ // Use sqlite to check if `conda update -y --all` went through successfully
293
+ // sometimes it just fails silently so need to check
294
+ if (name === "sqlite") {
295
+ let coerced = semver.coerce(version)
296
+ let sqlite_requirement = ">=3.47.2"
297
+ console.log({ coerced, version, sqlite_requirement })
298
+ if (semver.satisfies(coerced, sqlite_requirement)) {
299
+ console.log("semver satisfied")
300
+ conda_check.sqlite = true
301
+ } else {
302
+ console.log("semver NOT satisfied")
303
+ }
304
+ }
287
305
  }
288
306
  } else {
289
307
  if (/name.*version.*build.*channel/i.test(line)) {
@@ -294,7 +312,7 @@ class Bin {
294
312
  }
295
313
 
296
314
  console.log({ conda_check })
297
- if (conda_check.conda && conda_check.mamba) {
315
+ if (conda_check.conda && conda_check.mamba && conda_check.sqlite) {
298
316
  //if (conda_check.conda) {
299
317
  this.correct_conda = true
300
318
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.2.118",
3
+ "version": "3.2.120",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -2124,23 +2124,34 @@ class Server {
2124
2124
  } else {
2125
2125
  // update the py module if it's already installed
2126
2126
  console.log("not up to date")
2127
- let installed = await this.kernel.bin.mod.py.installed()
2128
- console.log("py installed", installed)
2129
- if (installed) {
2130
- // update
2131
- console.log("update py")
2132
- await this.kernel.exec({
2133
- message: "git pull",
2134
- path: this.kernel.path("bin/py")
2135
- }, (e) => {
2136
- console.log(e)
2137
- })
2138
-
2139
- }
2140
- // after updating, set the version
2141
- console.log("set the version", this.version.pinokiod)
2142
- this.kernel.store.set("version", this.version.pinokiod)
2143
- console.log("RESTART")
2127
+ await new Promise((resolve, reject) => {
2128
+ let interval = setInterval(async () => {
2129
+ console.log("checking mod.py")
2130
+ if (this.kernel.bin.mod && this.kernel.bin.mod.py) {
2131
+ console.log("mod.py initialized!")
2132
+ let installed = await this.kernel.bin.mod.py.installed()
2133
+ console.log("py installed", installed)
2134
+ if (installed) {
2135
+ // update
2136
+ console.log("update py")
2137
+ await this.kernel.exec({
2138
+ message: "git pull",
2139
+ path: this.kernel.path("bin/py")
2140
+ }, (e) => {
2141
+ console.log(e)
2142
+ })
2143
+ }
2144
+ // after updating, set the version
2145
+ console.log("set the version", this.version.pinokiod)
2146
+ this.kernel.store.set("version", this.version.pinokiod)
2147
+ console.log("RESTART")
2148
+ clearInterval(interval)
2149
+ resolve()
2150
+ } else {
2151
+ console.log("mod.py not initialized yet")
2152
+ }
2153
+ }, 1000)
2154
+ })
2144
2155
  this.listening = true // set this.listening = true so all http connections get reset when restarting
2145
2156
  await this.start(options)
2146
2157
  console.log("RESTARTED")