Commit Graph

4621 Commits

Author SHA1 Message Date
David Anderson f24fc22020 file sandbox: put 'file list' and 'add file' on different pages
file sandbox: use Location: to prevent repeating op on page reload
BUDA: add explanatory text
2024-12-04 17:51:46 -08:00
David Anderson e14f7154d9 BUDA: debug cmdline arg features
- file sandbox: add 'Get web file' option
- docker wrapper: always write container log output to stderr
- worker: write cmdline args to stderr
- worker: version# is 4
- fix bug in file sandbox display
- fix bug in BUDA variant delete
- BUDA variant name defaults to 'cpu'
- update examples files in samples/docker_wrapper/test_buda
2024-12-04 15:10:12 -08:00
David Anderson e38016d017 BUDA: add cmdline field to submission form.
Specifies cmdline args for all jobs in batch;
you can also specify per-job args, which come after.

create_work: add logic to support the above;
also fix bug involving pointers to stack vars (big no-no)
2024-12-04 01:42:50 -08:00
Vitalii Koshura ff7810bdbd
Merge pull request #5929 from BOINC/dpa_docker4
docker_wrapper: allow passing args into container
2024-12-03 12:26:03 +01:00
David Anderson 2ae1d9a9d1 docker_wrapper: unparsed cmdline args are passed to main program 2024-12-02 18:06:32 -08:00
makeasnek 2e6b246d3d
Update manage_apps.php
Fix broken links
2024-11-29 01:51:22 -08:00
David Anderson 07ee065bfe web: fix two undefined var bugs 2024-11-28 12:52:35 -08:00
David Anderson 0e4b59061c - improve batch page
correctly show # of in progress, error, done, unsent jobs
    fraction done is frac of success jobs
- Add 'verbose' checkbox for BUDA job submit.
    docker_wrapper prints stuff to stderr (can view on result page)
- fix bugs in non-BUDA submit pages
2024-11-28 01:13:51 -08:00
David Anderson 413e168448 BUDA job submission: add access control
and unify access control web and remote job submission
2024-11-26 00:02:39 -08:00
David Anderson 8a374a705c fix link to doc 2024-11-25 16:16:20 -08:00
David Anderson f70ae7f529 check GET args of buda_submit.php 2024-11-25 14:53:38 -08:00
David Anderson b6654b894f web (BUDA)
- validate URL args that are used as filenames; prevent ../ stuff.
    Do this by checking for '/'; is that sufficient?

- add 'delete app' function

- remove binary test file
2024-11-25 14:49:36 -08:00
David Anderson 3858f356ad job submission web: user friendlier
Principle: when showing jobs or files, use names that the user provided,
rather than DB IDs or names that BOINC generated.
2024-11-24 11:12:36 -08:00
David Anderson f8879a3a0e web job submission, script assimilator: add new output file model
old model:
    no assimilator
    output files live in upload hierarchy w/ physical names
    WUs are marked as assimulated when batch is retired;
    file_deleter deletes output files after that.

new model:
    assimilator (e.g. sample_assimilate.py and sample_assimilator.cpp)
    moves output files of canonical results to project/results/<batch_id>,
    with names that include the batch name and the logical name.
    WU is marked as assimilated; file_deleter deletes
    output files of non-canonical results.

advantages of new model:
    can see all output files of a batch on cmdline with ls
    can zip output files of a batch without copying them
    unified naming scheme for output files that encodes
        the batch, the job (e.g. the BUDA job dir name)
        and the logical name of the file.
------------
script assimilator: pass logical names to the script

Support both models.  Choice of model is per app.
The project.inc file says which app uses which model.
2024-11-23 23:35:40 -08:00
David Anderson dc47826575 improve BUDA web interface
For BUDA batches, description is '<app> (<variant>)'

Move job submission admin functions to their own page

Lay the groundwork for unifying output file handling
for remote job submission.
2024-11-22 17:12:22 -08:00
David Anderson 881a4c16b6 BUDA job submission now passes the basic end-to-end test - woo hoo!
When you run a shell script on Unix, and it has Windows line endings (CRLF),
it fails with a misleading 'file not found' error message.
This can cause problems with BUDA apps, which can involve shell scripts,
and all files go through the user sandbox.

For example: if you put the script (with Unix endings) into Github
and check it out on a Win machine, all of a sudden it has Win endings!
If you upload it to your sandbox, it won't work.

So I added a sandbox feature where you can add a file
by pasting text into a web form.
Surprisingly, even this changed the LF to a CRLF!
I changed the form handler to convert CRLF to LF, and now it works.

How many man-years have been wasted on this line-ending BS?
I'm guessing the blame goes to Microsoft.
2024-11-21 12:31:47 -08:00
David Anderson 1b017e173f add buda test files
buda: output files are <copy_file/>
2024-11-21 01:42:22 -08:00
David Anderson 415696ba6a dockerwrapper: work dir defaults to /app 2024-11-21 00:59:13 -08:00
David Anderson 160cc3de8e docker wrapper: it's OK if no config file 2024-11-20 18:48:12 -08:00
David Anderson df4a8b50a7 BUDA job submission: fill in some missing logic.
It works now, to the extent of staging files properly
and creating plausible-looking workunits.
Next step: see if they work.
2024-11-19 23:52:56 -08:00
David Anderson fd044d62f0 added (undebugged) code for BUDA job submission.
changes:
- creating a variant creates a JSON file, variant.json,
    describing the dockerfile, app files, and in/out files.
    Template files are now generated during job submission.
- no aliasing of files.  If your main prog is foo,
    your Dockerfile must end with CMD ./foo
- batch zip file must have shared input files
    in a directory shared_input_files/.
    All other directories are jobs.
2024-11-19 17:55:31 -08:00
David Anderson bc4cb3bb68 - Add web interface for creating BUDA apps and variants
variants are stored in <project>/buda_apps/<app>/<variant>.
    This includes app files (copied from sandbox) and templates
    (generated by handler)
- Add web interface for submitting BUDA jobs (not finished)
- Change implementation of user file sandbox
    old: sandbox dir had 'link files' containing md5 and size;
        actual file is in download hierarchy with sb_md5 name
    new: sandbox dir has actual files.
        parallel .md5/ dir has 'info files' (md5 size)
        Files are not stored in download hierarchy.
    New philosophy: names in the download hierarchy include
        not only an MD5 (for uniqueness)
        but also text describing the use of the file
        (input file for a batch, part of a BUDA app, etc.).
        This may allow duplicate files,
        but it makes it possible to always clean up unused files.

- use readdir() instead of opendir()/scandir()
2024-11-18 13:43:44 -08:00
David Anderson b81573b660 add script to show Linux libc and vbox version counts: ops/host_stats.php 2024-11-07 17:17:51 -08:00
Vitalii Koshura fc7ecbfe6f
Merge pull request #5868 from BOINC/dpa_profile
web: parse gd version number correctly
2024-10-30 11:03:46 +01:00
Ashley CallMeFoxie 153577c77d subs should be empty by default, not null 2024-10-22 11:33:18 +02:00
Vitalii Koshura af2bf980d8
Merge pull request #5846 from BOINC/dpa_username
web: don't allow special chars in user names.
2024-10-21 23:31:39 +02:00
David Anderson 7c4f7c9ed4 web: fix PHP8 deprecation warnings 2024-10-21 10:30:35 -07:00
David Anderson 3b1edd176c web: don't allow special chars in user names.
Check this (and show appropriate message) in both account creation
and user name update
2024-10-11 02:32:29 -07:00
Vitalii Koshura 7d74d5e32e
Merge pull request #5832 from BOINC/dpa_forum9
web: forums: fix 'mark all threads as read' function
2024-10-04 10:38:29 +02:00
David Anderson 3dec8f8086 web: fix PHP warning from showing subscriptions without user login 2024-10-04 01:02:48 -07:00
David Anderson ec47f0830b web: forums: fix 'mark all threads as read' function 2024-10-03 18:48:47 -07:00
Vitalii Koshura fa2474f516
fix typo
Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
2024-09-15 03:21:31 +02:00
David Anderson 399c78e56c fix typo in script to cancel WUs
Don't use hardwired constants in DB queries.

Note: we have 2 scripts that do about the same thing
ops/cancel_workunits.php
ops/cancel_wu_form.php
Both are linked to from ops page.  Remove one of them.
2024-09-14 15:49:23 -07:00
David Anderson 5e2104524d remote job submission: remove debugging code 2024-09-13 12:21:56 -07:00
David Anderson 242786b6c0 scheduler: fix WSL plan class
admin web: fix bug in opening DB
2024-09-04 21:27:13 -07:00
David Anderson 66440f90f1
Merge pull request #5697 from BOINC/dpa_replica
PHP DB code: clean up the logic, and allow for > 1 readonly replica
2024-08-31 10:48:10 -07:00
David Anderson da1727c64f BoincDb::get():
if open to different dbnum, close and reconnect.
Don't throw exception if connect fails
2024-08-17 12:17:25 -07:00
David Anderson 7fb55d67a8 database: report connection failure in _mysql_connect()
This is used in the upgrade script and some old web pages.
You need to check $mysql->connect_errno after doing new mysqli
2024-08-15 23:06:59 -07:00
David Anderson 6d66e9e035 forums: 'subscribe' checkbox is initially unchecked 2024-08-13 16:33:09 -07:00
David Anderson e6c2fc2bc2 web: add an optional project-specific intro in forum index.
(so the BOINC web site doesn't need a custom version of the file).
2024-08-07 16:11:11 -07:00
David Anderson a9a2a5852f web: when create or post to a thread, add option for subscribing (default on) 2024-08-06 18:20:36 -07:00
David Anderson 631dab3155 web: forum and PM cleanup
- don't use tables when they're not needed.
    In light mode, bootstrap puts noisy lines around them

- use constants PM_LH_PCT and FORUM_LH_PCT for width
    of left (informational) column.

- show lists of posts (user posts, search results) in 2-column format

- use functions like row2() rather than <tr><td>...

- forums: show header (search box, PM links) only in top-level pages.
    Not needed on e.g. form for posting a message

- change page titles to say what you're looking at (forum, thread)

- use sprintf() instead of long concatenations

- make terminology consistent:
    you 'post' to a thread or you 'reply' to a message.
    You don't reply to a thread.
2024-08-06 16:04:55 -07:00
David Anderson 81f9ab467a - add ops script to check for users to large numbers of hosts.
Could be evidence of botnets, like the recent one.
- scheduler: update comments in authenticate_user()
2024-08-05 16:33:29 -07:00
Vitalii Koshura 2839b58ff6
Merge pull request #5729 from BOINC/dpa_user_perm
web: fix user permissions admin
2024-08-03 12:54:53 +02:00
David Anderson 8389bc38d1
web: facilitate unsubscription
On the main Forums page, show all subscriptions
(to both threads and forums) with checkboxes,
so you can unsubscribe to multiple items at once.

Modernize the forum code here and there.
- Get rid of <span>s - we don't do our own CSS anymore.
- Have functions return strings rather than printing text;
    it makes them more general.
- Use table_row() etc. instead of printing <td> etc.
- Move code from top level to functions
- start_table() and end_table() always at same code level
2024-08-03 12:49:50 +02:00
David Anderson bdc2a4a3fa web: fix user permissions admin
- only admins (which actually includes ADMIN, DEV, and SCIENTIST)
    can administer user permissions (not, e.g. moderators)
- Add a link to the user-permissions admin page on the home page of admins
    (there were previously no links to it)
- modernize the code of the admin page; replace _mysql_query() stuff
2024-08-03 00:24:22 -07:00
Vitalii Koshura 44aa413d92
Merge pull request #5727 from BOINC/dpa_email_check
fix email address checks
2024-08-02 10:11:44 +02:00
David Anderson 41e1aeac30
web: fix email address checks
There are two types of email address check:
1) syntax check
2) stopforumspam.com (SFS) check: enabled by USE_STOPFORUMSPAM in project.inc

- Separate these.  Sometimes it's appropriate to use just syntax check.
    When we do use SFS check, and the email is flagged,
    we should tell the user what happened;
    maybe they're incorrectly in the SFS DB.
- use PHP's filter_var() for the syntax check,
    rather than our own funky regexp.
2024-08-02 08:35:13 +02:00
David Anderson 312b0b7e76
server status page: show remote scheduler correctly
The scheduler is a CGI program, not a daemon; it doesn't have a PID file.
So the only way we can see if it's 'running'
is to check the 'stop_sched' trigger file.
Do this whether the scheduler is local or remote.
2024-08-02 08:32:04 +02:00
David Anderson 4b4ba9dbf8 A couple of additions to the BoincDb class:
- a close() method, closes the connection
- a $dbnum member: which replica you're connected to (0 if main DB)

Also, BoincDb doesn't inherit DbConn.
2024-08-01 14:24:45 -07:00