pinokiod 3.2.120 → 3.2.123
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.
- package/kernel/bin/conda.js +72 -1
- package/kernel/bin/index.js +12 -11
- package/package.json +1 -1
package/kernel/bin/conda.js
CHANGED
|
@@ -90,10 +90,80 @@ create_default_packages:
|
|
|
90
90
|
// - python=3.10`)
|
|
91
91
|
// }
|
|
92
92
|
// }
|
|
93
|
+
async check() {
|
|
94
|
+
let res = await this.kernel.bin.exec({ message: `conda list` }, (stream) => {
|
|
95
|
+
// console.log("conda list check", { stream })
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
console.log("CONDA", res.response)
|
|
99
|
+
lines = res.response.split(/[\r\n]+/)
|
|
100
|
+
let conda_check = {}
|
|
101
|
+
for(let line of lines) {
|
|
102
|
+
let chunks = line.split(/\s+/).filter(x => x)
|
|
103
|
+
if (chunks.length > 1) {
|
|
104
|
+
let name = chunks[0]
|
|
105
|
+
let version = chunks[1]
|
|
106
|
+
conda.add(name)
|
|
107
|
+
if (name === "conda") {
|
|
108
|
+
if (String(version) === "24.11.1") {
|
|
109
|
+
conda_check.conda = true
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// check conda-libmamba-solver is up to date
|
|
113
|
+
// sometimes it just fails silently so need to check
|
|
114
|
+
if (name === "conda-libmamba-solver") {
|
|
115
|
+
//if (String(version) === "24.7.0") {
|
|
116
|
+
let channel = chunks[3]
|
|
117
|
+
let coerced = semver.coerce(version)
|
|
118
|
+
let mamba_requirement = ">=24.11.1"
|
|
119
|
+
console.log({ name, channel, version })
|
|
120
|
+
if (semver.satisfies(coerced, mamba_requirement) && channel === "conda-forge") {
|
|
121
|
+
conda_check.mamba = true
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Use sqlite to check if `conda update -y --all` went through successfully
|
|
126
|
+
// sometimes it just fails silently so need to check
|
|
127
|
+
if (name === "sqlite") {
|
|
128
|
+
let coerced = semver.coerce(version)
|
|
129
|
+
let sqlite_requirement = ">=3.47.2"
|
|
130
|
+
console.log({ coerced, version, sqlite_requirement })
|
|
131
|
+
if (semver.satisfies(coerced, sqlite_requirement)) {
|
|
132
|
+
console.log("semver satisfied")
|
|
133
|
+
conda_check.sqlite = true
|
|
134
|
+
} else {
|
|
135
|
+
console.log("semver NOT satisfied")
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
console.log("> Check", { conda_check })
|
|
141
|
+
return conda_check.conda && conda_check.mamba && conda_check.sqlite
|
|
142
|
+
}
|
|
93
143
|
async install(req, ondata) {
|
|
144
|
+
for(let i=0; i<5; i++) {
|
|
145
|
+
await this._install(req, ondata)
|
|
146
|
+
let installed = await this.check()
|
|
147
|
+
if (installed) {
|
|
148
|
+
console.log("Conda properly installed and updated")
|
|
149
|
+
return
|
|
150
|
+
} else {
|
|
151
|
+
console.log("Conda NOT roperly installed and updated. Trying again...")
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
async _install(req, ondata) {
|
|
94
156
|
const installer_url = this.urls[this.kernel.platform][this.kernel.arch]
|
|
95
157
|
const installer = this.installer[this.kernel.platform]
|
|
96
158
|
const install_path = this.kernel.bin.path("miniconda")
|
|
159
|
+
let install_path_exists = await this.kernel.exists("miniconda")
|
|
160
|
+
if (install_path_exists) {
|
|
161
|
+
console.log("Install path already exists. Removing...", install_path)
|
|
162
|
+
await fs.promises.rm(install_path, { recursive: true }).catch((e) => {
|
|
163
|
+
})
|
|
164
|
+
} else {
|
|
165
|
+
console.log("Install path does not exist. Installing...")
|
|
166
|
+
}
|
|
97
167
|
|
|
98
168
|
ondata({ raw: `downloading installer: ${installer_url}...\r\n` })
|
|
99
169
|
await this.kernel.bin.download(installer_url, installer, ondata)
|
|
@@ -144,7 +214,7 @@ create_default_packages:
|
|
|
144
214
|
`conda config --file ${this.kernel.path('condarc')} --set remote_max_retries 6`,
|
|
145
215
|
`conda config --file ${this.kernel.path('condarc')} --set repodata_threads 4`,
|
|
146
216
|
`conda config --file ${this.kernel.path('condarc')} --set fetch_threads 5`,
|
|
147
|
-
"conda install -y -c conda-forge conda-libmamba-solver=24.11.1",
|
|
217
|
+
// "conda install -y -c conda-forge conda-libmamba-solver=24.11.1",
|
|
148
218
|
// "conda install libsqlite --force-reinstall -y",
|
|
149
219
|
// `conda config --file ${this.kernel.path('condarc')} --set auto_update_conda False`,
|
|
150
220
|
//"conda install -y conda=24.9.0 -vvv --strict-channel-priority",
|
|
@@ -152,6 +222,7 @@ create_default_packages:
|
|
|
152
222
|
//"conda install -y conda-libmamba-solver=24.7.0 conda=24.7.1 -vvv --strict-channel-priority",
|
|
153
223
|
//"conda install -y conda-libmamba-solver=24.11.1 conda=24.7.1",
|
|
154
224
|
//"conda install -y conda-libmamba-solver=24.11.1 conda=24.11.2",
|
|
225
|
+
"conda update -y conda-libmamba-solver",
|
|
155
226
|
"conda update -y --all",
|
|
156
227
|
// "conda update -y conda",
|
|
157
228
|
// "conda update -y --all",
|
package/kernel/bin/index.js
CHANGED
|
@@ -278,16 +278,16 @@ class Bin {
|
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
// check conda-libmamba-solver is up to date
|
|
282
|
-
// sometimes it just fails silently so need to check
|
|
283
|
-
if (name === "conda-libmamba-solver") {
|
|
284
|
-
//if (String(version) === "24.7.0") {
|
|
285
|
-
let channel = chunks[3]
|
|
286
|
-
console.log({ name, channel, version })
|
|
287
|
-
if (String(version) === "24.11.1" && channel === "conda-forge") {
|
|
288
|
-
conda_check.mamba = true
|
|
289
|
-
}
|
|
290
|
-
}
|
|
281
|
+
// // check conda-libmamba-solver is up to date
|
|
282
|
+
// // sometimes it just fails silently so need to check
|
|
283
|
+
// if (name === "conda-libmamba-solver") {
|
|
284
|
+
// //if (String(version) === "24.7.0") {
|
|
285
|
+
// let channel = chunks[3]
|
|
286
|
+
// console.log({ name, channel, version })
|
|
287
|
+
// if (String(version) === "24.11.1" && channel === "conda-forge") {
|
|
288
|
+
// conda_check.mamba = true
|
|
289
|
+
// }
|
|
290
|
+
// }
|
|
291
291
|
|
|
292
292
|
// Use sqlite to check if `conda update -y --all` went through successfully
|
|
293
293
|
// sometimes it just fails silently so need to check
|
|
@@ -312,7 +312,8 @@ class Bin {
|
|
|
312
312
|
}
|
|
313
313
|
|
|
314
314
|
console.log({ conda_check })
|
|
315
|
-
if (conda_check.conda && conda_check.mamba && conda_check.sqlite) {
|
|
315
|
+
//if (conda_check.conda && conda_check.mamba && conda_check.sqlite) {
|
|
316
|
+
if (conda_check.conda && conda_check.sqlite) {
|
|
316
317
|
//if (conda_check.conda) {
|
|
317
318
|
this.correct_conda = true
|
|
318
319
|
}
|