Skip to content

Commit eb189a6

Browse files
Merge branch 'master' of github.com:sagemathinc/cocalc into openapi/obsolete-legacy-docs
2 parents 58cec2f + ec9e38f commit eb189a6

File tree

250 files changed

+11323
-1795
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

250 files changed

+11323
-1795
lines changed

.github/workflows/make-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Install python3 requests
4141
run: sudo apt-get install python3-requests
4242
- name: Check doc links
43-
run: cd src/scripts && python3 check_doc_urls.py
43+
run: cd src/scripts && python3 check_doc_urls.py || sleep 5 || python3 check_doc_urls.py
4444

4545
build:
4646
runs-on: ubuntu-latest

src/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,12 @@ which installs exactly the right packages, and builds the code.
180180

181181
See `packages/backend/data.ts` . In particular, you can set BASE_PATH, DATA, PGHOST, PGDATA, PROJECTS, SECRETS to override the defaults. Data is stored in `cocalc/src/data/` by default.
182182

183-
#### Filesystem Build Caching
183+
#### File System Build Caching
184184

185-
There are two types of filesystem build caching. These greatly improve the time to compile typescript or start webpack between runs. However, in rare cases bugs may lead to weird broken behavior. Here's where the caches are, so you know how to clear them to check if this is the source of trouble. _As of now, I'm_ _**not**_ _aware of any bugs in filesystem caching._
185+
There are two types of file system build caching. These greatly improve the time to compile typescript or start webpack between runs. However, in rare cases bugs may lead to weird broken behavior. Here's where the caches are, so you know how to clear them to check if this is the source of trouble. _As of now, I'm_ _**not**_ _aware of any bugs in file system caching._
186186

187187
- In the `dist/` subdirectory of a package, there's a file `tsconfig.tsbuildinfo` that caches incremental typescript builds, so running `tsc` is much faster. This is enabled by setting `incremental: true` in `tsconfig.json`. I've never actually seen a case where caching of this file caused a problem (those typescript developers are careful).
188-
- Webpack caches its builds in `/tmp/webpack` . This is configured in `packages/static/webpack.config.js` , and we use `/tmp` since random access file system performance is critical for this **large** GB+ cache -- otherwise, it's almost slower than no cache. (I also benchmarked tsc, and it works fine on a potentially slow local filesystem.) I did sees bugs with this cache when I had some useless antd tree shaking plugin enabled, but I have never seen any problems with it since I got rid of that.
188+
- Webpack caches its builds in `/tmp/webpack` . This is configured in `packages/static/webpack.config.js` , and we use `/tmp` since random access file system performance is critical for this **large** GB+ cache -- otherwise, it's almost slower than no cache. (I also benchmarked tsc, and it works fine on a potentially slow local file system.) I did sees bugs with this cache when I had some useless antd tree shaking plugin enabled, but I have never seen any problems with it since I got rid of that.
189189

190190
#### Creating an admin user
191191

src/compute/compute/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ pnpm build
2323
- You \(and collabs\) can then use this power from cocalc on your laptop.
2424
- A web browser with WebGPU [providing PyTorch](https://praeclarum.org/2023/05/19/webgpu-torch.html) \(say\).
2525

26-
## The filesystem
26+
## The File System
2727

28-
The filesystem from the project will get mounted via [WebSocketFS](https://github.com/sagemathinc/websocketfs). This will initially only be for FUSE, but later could also use WASI in the browser.
28+
The file system from the project will get mounted via [WebSocketFS](https://github.com/sagemathinc/websocketfs). This will initially only be for FUSE, but later could also use WASI in the browser.
2929

3030
## Status
3131

src/compute/compute/lib/filesystem.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Mount a remote CoCalc project's filesystem locally over a websocket using FUSE.
2+
Mount a remote CoCalc project's file system locally over a websocket using FUSE.
33
44
await require('.').mount({remote:'wss://cocalc.com/10f0e544-313c-4efe-8718-2142ac97ad11/raw/.smc/websocketfs',path:process.env.HOME + '/dev2', connectOptions:{perMessageDeflate: false, headers: {Cookie: require('cookie').serialize('api_key', 'sk-at7ALcGBKMbzq7Vc00000P')}}})
55
@@ -39,9 +39,9 @@ interface Options {
3939
unionfs?: {
4040
upper: string;
4141
lower: string;
42-
// If true, doesn't do anything until the type of the filesystem that lower is
42+
// If true, doesn't do anything until the type of the file system that lower is
4343
// mounted on is of this type, e.g., "fuse". This is done *INSTEAD OF* just
44-
// trying to mount that filesystem. Why? because in docker we hit a deadlock
44+
// trying to mount that file system. Why? because in docker we hit a deadlock
4545
// when trying to do both in the same process (?), which I can't solve -- maybe
4646
// a bug in node. In any case, separating the unionfs into a separate container
4747
// is nice anyways.
@@ -160,7 +160,7 @@ export async function mountProject({
160160
// modified = ignore any file modified with this many seconds (at least);
161161
// also ignores any file not in the stat cache.
162162
readTrackingFile: readTrackingFile,
163-
readTrackingExclude: [".*", ...exclude],
163+
readTrackingExclude: exclude,
164164
// metadata file
165165
metadataFile,
166166
}));

src/compute/compute/lib/manager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ interface Options {
4040
// it should be the id in the database from the compute_servers table.
4141
compute_server_id: number;
4242
// HOME = local home directory. This should be a network mounted (or local)
43-
// filesystem that is identical to the home directory of the target project.
43+
// file system that is identical to the home directory of the target project.
4444
// The ipynb file will be loaded and saved from here, and must exist, and
4545
// process.env.HOME gets set to this.
4646
home: string;
47-
// If true, doesn't do anything until the type of the filesystem that home is
47+
// If true, doesn't do anything until the type of the file system that home is
4848
// mounted on is of this type, e.g., "fuse".
4949
waitHomeFilesystemType?: string;
5050
}
@@ -117,7 +117,7 @@ class Manager {
117117
this.state = "init";
118118
// Ping to start the project and ensure there is a hub connection to it.
119119
await pingProjectUntilSuccess(this.project_id);
120-
// wait for home direcotry filesystem to be mounted:
120+
// wait for home direcotry file system to be mounted:
121121
if (this.waitHomeFilesystemType) {
122122
this.reportComponentState({
123123
state: "waiting",

src/dev/minimal/start_postgres.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Lock down authentication so it is ONLY via unix socket
1717
open(os.path.join(PG_DATA,'pg_hba.conf'), 'w').write(
1818
"""
19-
# This is safe since we only enable a socket protected by filesystem permissions:
19+
# This is safe since we only enable a socket protected by file system permissions:
2020
local all all trust
2121
2222
# You can uncomment this and comment out the above if you want to test password auth.

src/dev/project/start_postgres.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
# Lock down authentication so it is ONLY via unix socket
2020
open(os.path.join(PG_DATA, 'pg_hba.conf'), 'w').write("""
21-
# This is safe since we only enable a socket protected by filesystem permissions:
21+
# This is safe since we only enable a socket protected by file system permissions:
2222
local all all trust
2323
2424
# You can uncomment this and comment out the above if you want to test password auth.

src/packages/assets/misc/talk-20121004/index.html

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<!--
1+
<!--
22
This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
33
License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
44
-->
55

6-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
6+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
77
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
88

99
<html xmlns="http://www.w3.org/1999/xhtml">
@@ -106,7 +106,7 @@ <h1>sage-support mailing list a few days ago</h1>
106106
<font size=+3>
107107
<pre>
108108
On Wed, Sep 26, 2012 at 9:54 AM, Chris Seberino <cseberino@gmail.com> wrote:
109-
> I have a Xen Ubuntu Linux 1 Gb RAM virtual machine from a provider
109+
> I have a Xen Ubuntu Linux 1 Gb RAM virtual machine from a provider
110110
> called Linode.
111111
>
112112

@@ -314,18 +314,18 @@ <h1>Architecture Diagram</h1>
314314
/|\
315315
| (sockjs)
316316
Stunnels ... (https://salv.us)
317-
|
318317
|
319-
\|/
318+
|
319+
\|/
320320
HAProxy Load Balancers ... Nginx static servers ...
321321
/|\ /|\ /|\ /|\
322322
| | | | [tinc vpn]
323-
|https1.1 | | |
324-
\|/ \|/ \|/ \|/
323+
|https1.1 | | |
324+
\|/ \|/ \|/ \|/
325325
Tornado Tornado Tornado Tornado <------------------> Cassandra ...
326326
/|\ /|\ /|\
327327
| | -----------------------------------|
328-
---------| | |
328+
---------| | |
329329
| | |
330330
| | |
331331
\|/ \|/ \|/
@@ -365,7 +365,7 @@ <h1>Virtualization: libvirt + kvm</h1>
365365
disk images).</li>
366366
<li> <b>The <i>only</i> persistent data:</b> in all of Salvus is in the distributed
367367
database. This will sit in a disk partition that is
368-
encrypted using the Linux ecryptfs filesystem and a passphrase
368+
encrypted using the Linux ecryptfs file system and a passphrase
369369
that I type in (exactly once from my management interface) when
370370
launching the database. </li>
371371
</ul>
@@ -384,7 +384,7 @@ <h1>Private Cloud Distributions</h1>
384384
making noise about implementing something open source kind of like
385385
what Amazon and VMware already did, but with a lot of the truly hard
386386
real work being doing by libvirt. (This will likely be useful for
387-
something in a year or two, and now if you <a href="http://www.ubuntu.com/cloud/solutions">pay companies money</a>,
387+
something in a year or two, and now if you <a href="http://www.ubuntu.com/cloud/solutions">pay companies money</a>,
388388
but now it is worse than useless...)
389389
</li>
390390
<li> The real work is done by libvirt, kvm (or xen). Evidently, Redhat put a ton
@@ -406,7 +406,7 @@ <h1>VPN: Motivation</h1>
406406

407407
<li>By using a VPN, Salvus can easily combine cloud computers, my own
408408
computers, etc., and don't have to worry about ip addresses
409-
changing.
409+
changing.
410410
</li>
411411
<li> We don't have to worry about securing
412412
communication between the different services or vm's in salvus.
@@ -434,7 +434,7 @@ <h1>VPN I chose: tinc</h1>
434434
<li> Public-facing machines on the VPN also acts as
435435
servers, so clients can connect to VPN as long as at least one public-facing
436436
machine is up. </li>
437-
<li> It's P2P -- traffic does not all go through one
437+
<li> It's P2P -- traffic does not all go through one
438438
master node, which could be very inefficient. </li>
439439
<li> All traffic is encrypted.</li>
440440
<li> Easy/sensible; to add a machine to the VPN, you just
@@ -444,7 +444,7 @@ <h1>VPN I chose: tinc</h1>
444444
</ul>
445445
</li>
446446
</ul></div>
447-
447+
448448

449449

450450

@@ -465,14 +465,14 @@ <h1>Database: the memory of Salvus</h1>
465465
databases based on usernames. (I also read a lot about
466466
SQLalchemy, used PostgreSQL a lot, etc.)</li>
467467
<li>Then the Padelford server room blew up for the <i>n</i>-th time, and I
468-
firmly decided on no SPOF's as an <i>Axiom</i>.
468+
firmly decided on no SPOF's as an <i>Axiom</i>.
469469
</ul>
470470
</div>
471471

472472
<div class="slide">
473473
<h1>Database: noSQL</h1>
474474
<ul>
475-
<li> NO SPOFS!:
475+
<li> NO SPOFS!:
476476
Relational databases like PostgreSQL become even more difficult to
477477
use with this constraint. You have to have a master database, at least one other slave
478478
databases replicating it, and some sort of automatic failover that
@@ -492,7 +492,7 @@ <h1>Database: noSQL</h1>
492492
how redundant they are. I had learned a lot about MongoDB (a
493493
noSQL database) a few years ago, and after getting LMFDB.org to
494494
use it a lot (and using it for my own database work), I think it
495-
sucks.... for me at least.
495+
sucks.... for me at least.
496496

497497
<a href="http://news.ycombinator.com/item?id=4570790">"Does everyone hate MongoDB?"</a>
498498
</li>
@@ -555,7 +555,7 @@ <h1>SSL: stunnel</h1>
555555
<h1>Load balancing: haproxy</h1>
556556
The stunnel process directs all requests to another program called
557557
haproxy (which can be running on a different computer or the same
558-
computer).
558+
computer).
559559
<ul>
560560
<li>Haproxy is pretty much the canonical open source load balancer
561561
program.</li>
@@ -630,7 +630,7 @@ <h1>Math/compute: forking tcp-based Sage server</h1>
630630
with various things pre-imported such as graphics, Maxima, etc.,
631631
listens on a socket (running as root), accepts a connection, forks,
632632
lowers privileges, executes blocks of sage code, and streams results
633-
back over the connection.
633+
back over the connection.
634634
</li>
635635
<li>The design is much different than with the Sage notebook, where one
636636
process watches another. Here, as code executes, the running process
@@ -661,7 +661,7 @@ <h1>Service Management: approaches</h1>
661661
software on a bunch of machine. I found one called Ansible that I
662662
kind of liked at first, but found it to be too immature and not so
663663
widely used. There were some other solutions, but they seemed like
664-
massive overkill. I spent quite a bit of time investigating them.
664+
massive overkill. I spent quite a bit of time investigating them.
665665
But for every actual application, there is a bunch of subtle logic
666666
that just has to be figured out and coded, and I had a lot of that down
667667
from my code mentioned above.</li>

src/packages/backend/data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
22
Where Data is Stored:
33
4-
We centralize here determination of all directories on the filesystem
4+
We centralize here determination of all directories on the file system
55
where data is stored for any of the components of CoCalc, run in any way.
66
77
All information here must be determinable when this module is initialized,
8-
e.g., from environment variables or heuristics involving the filesystem.
8+
e.g., from environment variables or heuristics involving the file system.
99
In particular, nothing here can be impacted by command line flags
1010
or content of a database.
1111
*/

src/packages/backend/files/delete-files.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export async function delete_files(
3333
// - that results in weird race conditions that can make files immediately
3434
// reappear after deletion
3535
// - we MUST make deletion detection fully work based entirely on what happens
36-
// on the filesystem, e.g., due to git checkout and people using the terminal
36+
// on the file system, e.g., due to git checkout and people using the terminal
3737
log.debug("extra = ", extra);
3838
await rimraf(paths.concat(extra), { maxRetries: 2 });
3939
}

0 commit comments

Comments
 (0)