Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 39 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,14 @@ endif()
# job-side scripts the Launcher copies to compute hosts, the per-session
# gateway scripts, ecce-remote-setup) and ecce-server (the per-user
# or central WebDAV data server and its content, its mosquitto
# dependency). Every install() rule below carries a
# dependency), with the optional ecce-server-tui administration package.
# Every install() rule below carries a
# COMPONENT tag either way -- that costs nothing when this is OFF, since
# plain `cpack`/`cpack -G DEB` ignores COMPONENT entirely and produces
# one monolithic package exactly as before (CPACK_DEB_COMPONENT_INSTALL
# defaults OFF). Turning this ON is what makes CPack actually split them.
# ON from 9.0 (ecce-client and ecce-server); 8.x release branches are monolithic.
option(ECCE_SPLIT_PACKAGES "Package ecce-client and ecce-server as separate .deb/.rpm files instead of one monolithic package" ON)
# ON from 9.0 (ecce-client, ecce-server, and ecce-server-tui); 8.x release branches are monolithic.
option(ECCE_SPLIT_PACKAGES "Package ecce-client, ecce-server, and ecce-server-tui separately instead of one monolithic package" ON)

add_compile_options(
"$<$<COMPILE_LANGUAGE:CXX>:-Wall>"
Expand Down Expand Up @@ -1251,17 +1252,26 @@ endforeach()
# below); nothing to vendor/extract here since both are ordinary Debian
# packages.
# ------------------------------------------------------------------------
# The dataserver's own start/stop/status/adduser: only meaningful on a
# machine actually running the Apache instance, so these -- and the
# Apache config they resolve -- are server-only.
# The data-server service tools ship with ecce-server. The optional TUI is
# separate so headless/server-only installations do not need its Textual
# runtime dependency. It still runs as the account that owns the Apache
# instance and depends on ecce-server at package-install time.
install(PROGRAMS
${CMAKE_SOURCE_DIR}/packaging/dataserver/ecce-dataserver-start
${CMAKE_SOURCE_DIR}/packaging/dataserver/ecce-dataserver-stop
${CMAKE_SOURCE_DIR}/packaging/dataserver/ecce-dataserver-status
${CMAKE_SOURCE_DIR}/packaging/dataserver/ecce-dataserver-adduser
${CMAKE_SOURCE_DIR}/packaging/dataserver/ecce-dataserver-deluser
${CMAKE_SOURCE_DIR}/packaging/dataserver/ecce-dataserver-cert-generate
${CMAKE_SOURCE_DIR}/packaging/dataserver/ecce-site-publish
DESTINATION bin
COMPONENT server)
install(PROGRAMS ${CMAKE_SOURCE_DIR}/packaging/dataserver/ecce-server-tui
DESTINATION bin
COMPONENT tui)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/packaging/dataserver/tui/ecce_server_tui
DESTINATION lib
COMPONENT tui)
install(FILES ${CMAKE_SOURCE_DIR}/packaging/dataserver/httpd.conf.ecce
DESTINATION server/httpd-conf
COMPONENT server)
Expand Down Expand Up @@ -1310,7 +1320,7 @@ fi
exec \"$ECCE_HOME/bin/ecce-launch\" \"$@\"
")
install(PROGRAMS ${_launch_wrapper} DESTINATION ${ECCE_WRAPPER_DESTINATION} COMPONENT client)
foreach(_ds start stop status adduser)
foreach(_ds start stop status adduser deluser cert-generate)
set(_ds_wrapper ${CMAKE_BINARY_DIR}/wrappers/ecce-dataserver-${_ds})
file(WRITE ${_ds_wrapper}
"#!/bin/bash
Expand All @@ -1322,6 +1332,15 @@ exec \"$ECCE_HOME/bin/ecce-dataserver-${_ds}\" \"$@\"
install(PROGRAMS ${_ds_wrapper} DESTINATION ${ECCE_WRAPPER_DESTINATION} COMPONENT server)
endforeach()

set(_server_tui_wrapper ${CMAKE_BINARY_DIR}/wrappers/ecce-server-tui)
file(WRITE ${_server_tui_wrapper}
"#!/bin/bash
${ECCE_HOME_SH}
export ECCE_REALUSERHOME=\${ECCE_REALUSERHOME:-$HOME}
exec \"$ECCE_HOME/bin/ecce-server-tui\" \"$@\"
")
install(PROGRAMS ${_server_tui_wrapper} DESTINATION ${ECCE_WRAPPER_DESTINATION} COMPONENT tui)

# The same wrapper for the central-server setup helper, so an
# administrator can type "ecce-remote-setup <host>" without knowing
# where the installation lives.
Expand Down Expand Up @@ -2055,7 +2074,7 @@ set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
# mod_ssl is in the apache2 package on Debian but its own package on RPM.
# xterm: editing an input file with the default editor (vi) opens it in
# an xterm (UserEditor.C).
set(CPACK_DEBIAN_PACKAGE_DEPENDS "apache2, apache2-utils, python3-wxgtk4.0, python3-numpy, python3-tqdm, python3-gemmi, mosquitto, libaprutil1, perl, xterm, openssl")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "apache2, apache2-utils, python3-wxgtk4.0, python3-numpy, python3-tqdm, python3-gemmi, python3-textual, mosquitto, libaprutil1, perl, xterm, openssl")
# NWChem is a real Debian package (confirmed working: /usr/bin/nwchem,
# symlinked to nwchem.openmpi by the package itself) and the auto-register-
# this-machine flow (RunMgmt::registerLocalMachine()) defaults new machine
Expand Down Expand Up @@ -2110,7 +2129,7 @@ if(RPMBUILD_EXECUTABLE)
set(CPACK_RPM_PACKAGE_LICENSE "ECL-2.0")
set(CPACK_RPM_PACKAGE_GROUP "Applications/Engineering")
set(CPACK_RPM_PACKAGE_URL "https://github.com/FriendsofECCE/ECCE")
set(CPACK_RPM_PACKAGE_REQUIRES "httpd, httpd-tools, mod_ssl, openssl, python3-wxpython4, python3-numpy, python3-tqdm, perl, xterm, mosquitto, apr-util${_coin_rpm}")
set(CPACK_RPM_PACKAGE_REQUIRES "httpd, httpd-tools, mod_ssl, openssl, python3-wxpython4, python3-numpy, python3-tqdm, python3-textual, perl, xterm, mosquitto, apr-util${_coin_rpm}")
set(CPACK_RPM_PACKAGE_SUGGESTS "nwchem, openssh-clients, firefox")
set(CPACK_RPM_FILE_NAME RPM-DEFAULT)
# /opt/ecce is ours, but /opt itself is owned by filesystem(5). Without
Expand Down Expand Up @@ -2188,7 +2207,7 @@ set(CPACK_RPM_CLIENT_USER_FILELIST "${_ecce_rpm_filelist}")

# ---------------------------------------------------------------------------
# Split packaging (ECCE_SPLIT_PACKAGES). Every install() rule above already
# carries COMPONENT client/server; this block only decides whether CPack
# carries COMPONENT client/server/tui; this block only decides whether CPack
# acts on those tags at all, and what each resulting package's own
# metadata is. No ecce-common component: auditing every install() rule
# above by which side reads it, nothing was needed by both -- siteconfig/
Expand Down Expand Up @@ -2231,7 +2250,7 @@ if(ECCE_SPLIT_PACKAGES)
unset(CPACK_DEBIAN_PACKAGE_SUGGESTS)

set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_COMPONENTS_ALL client server)
set(CPACK_COMPONENTS_ALL client server tui)
# Each component becomes its own independently installable package
# rather than CPack's default of one combined "unspecified"-grouped
# archive; auto-shlibdeps and auto-provides/requires run separately per
Expand Down Expand Up @@ -2279,8 +2298,13 @@ if(ECCE_SPLIT_PACKAGES)
# The gateway scripts, ecce-remote-setup and the GUI-free job agent
# (launchjob, eccejobmaster, eccejobstore) ship in ecce-client, and a server
# needs them, so the server brings the client -- GUI libraries included,
# unused on a headless box. Accepted rather than a third package.
# unused on a headless box. A separate worker package is not warranted.
set(CPACK_DEBIAN_SERVER_PACKAGE_DEPENDS "apache2, apache2-utils, mosquitto, libaprutil1, openssl, ecce-client (= ${_ecce_deb_version})")
set(CPACK_DEBIAN_TUI_PACKAGE_NAME "ecce-server-tui")
set(CPACK_DEBIAN_TUI_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_TUI_PACKAGE_DESCRIPTION
"Extensible Computational Chemistry Environment - server administration terminal interface")
set(CPACK_DEBIAN_TUI_PACKAGE_DEPENDS "python3-textual, ecce-server (= ${_ecce_deb_version})")
set(CPACK_DEBIAN_SERVER_PACKAGE_BREAKS "ecce (<< ${ECCE_MONOLITHIC_BREAK_VERSION})")
set(CPACK_DEBIAN_SERVER_PACKAGE_REPLACES "ecce (<< ${ECCE_MONOLITHIC_BREAK_VERSION})")

Expand Down Expand Up @@ -2309,6 +2333,9 @@ if(ECCE_SPLIT_PACKAGES)
set(CPACK_RPM_SERVER_PACKAGE_NAME "ecce-server")
set(CPACK_RPM_SERVER_FILE_NAME RPM-DEFAULT)
set(CPACK_RPM_SERVER_PACKAGE_REQUIRES "httpd, httpd-tools, mod_ssl, openssl, mosquitto, apr-util, ecce-client = ${_ecce_deb_version}")
set(CPACK_RPM_TUI_PACKAGE_NAME "ecce-server-tui")
set(CPACK_RPM_TUI_FILE_NAME RPM-DEFAULT)
set(CPACK_RPM_TUI_PACKAGE_REQUIRES "python3-textual, ecce-server = ${_ecce_deb_version}")
set(CPACK_RPM_SERVER_PACKAGE_OBSOLETES "ecce < ${ECCE_MONOLITHIC_BREAK_VERSION}")
set(CPACK_RPM_SERVER_PACKAGE_CONFLICTS "ecce < ${ECCE_MONOLITHIC_BREAK_VERSION}")
set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/opt")
Expand Down
59 changes: 51 additions & 8 deletions docs/INSTALLING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,28 @@ tested. To build your own instead, see

## 1. Install the packages

9.x comes as two packages: `ecce-client` (the applications) and
`ecce-server` (the data server and broker; it needs the client of the same
version). Install both for a standalone machine. On Debian 13, from the
directory you downloaded them to:
9.x comes as `ecce-client` (the applications), `ecce-server` (the data
server and broker; it needs the client of the same version), and the optional
`ecce-server-tui` administration interface. Install the client and server
for a standalone machine. On Debian 13, from the directory you downloaded
them to:

```
sudo apt install ./ecce-client_<version>_amd64.deb ./ecce-server_<version>_amd64.deb
```

To install the administration interface too, add its package:

```
sudo apt install ./ecce-client_<version>_amd64.deb ./ecce-server_<version>_amd64.deb ./ecce-server-tui_<version>_amd64.deb
```

The `./` matters: it tells apt these are local files, and apt then pulls
in the dependencies itself. `ecce-client` depends on `perl`, `xterm`,
`curl`, `libmosquitto1`, wxPython (`python3-wxgtk4.0`) and Coin3D;
`ecce-server` on Apache (`apache2`, `apache2-utils`), `mosquitto` and
`libaprutil1`. A machine that only connects to someone else's central
`libaprutil1`. `ecce-server-tui` depends on `ecce-server` and
`python3-textual`. A machine that only connects to someone else's central
server needs only `ecce-client`, and so does a computer that keeps its
data in a local folder (a local session runs ECCE's own message broker);
apt recommends `ecce-server` with it, and `--no-install-recommends` leaves
Expand All @@ -37,14 +45,21 @@ lines; your own lines there are kept) and reloads the profile; removing the
package takes the block out again. If you install `mosquitto` after ECCE,
run `sudo /opt/ecce/bin/ecce-apparmor-mosquitto install`.

On RHEL, Rocky or Fedora, `sudo dnf install ./ecce-client-<version>.x86_64.rpm
./ecce-server-<version>.x86_64.rpm`; on RHEL and Rocky run `sudo dnf install
On RHEL, Rocky or Fedora, install the client and server RPMs; add the TUI RPM
if you want the administration interface:

```
sudo dnf install ./ecce-client-<version>.x86_64.rpm ./ecce-server-<version>.x86_64.rpm ./ecce-server-tui-<version>.x86_64.rpm
```

On RHEL and Rocky run `sudo dnf install
epel-release` first, since Mosquitto and Coin3D (`Coin4`) come from EPEL. The
RPMs of 9.0.0-alpha.3 were run on RHEL 9; see
[Deployment modes](../GETTING_STARTED.md#deployment-modes).

ECCE installs to `/opt/ecce` and puts `ecce` and its helper commands
(`ecce-dataserver-adduser`, `ecce-remote-setup`, `ecce-diagnose`, …) on
(`ecce-dataserver-adduser`, `ecce-dataserver-deluser`, `ecce-remote-setup`,
`ecce-diagnose`, …) on
your `PATH`.

**macOS and Windows** (experimental): native clients are in preview
Expand Down Expand Up @@ -98,6 +113,34 @@ Use your Linux username — that's what the login dialog defaults to.
**On a central server** for a group or a class: the server's
administrator creates your account; see [Deployment modes](#deployment-modes).

The server administrator can run `ecce-server-tui` as the account that owns
the data server. Its Textual interface has separate screens for service
controls, users and groups, and profile setup. Within a profile, navigate among
data servers, compute resources, and job-creation codes; profiles can be
assigned to user groups and emailed to new or existing accounts. Profiles
include data-server URLs and public TLS pins, compute resource registrations,
queues, code paths and modules. They contain no passwords, SSH credentials or
private keys. Users enter their own data-server and compute-resource
credentials after loading the file in Preferences → Load Configuration. The
`ecce-server-tui` package installs Textual as a runtime dependency and
depends on the matching `ecce-server` version. When running from a source
checkout, install Textual for the Python interpreter used to launch the TUI.

TLS certificate actions are in the shared data-server definition form: load a
public certificate pin, generate a certificate/key pair, or load a pair and
enable TLS for the local server and broker. Only the public certificate is
included in client profiles.

Data servers and compute resources are defined in the shared resource catalog
and referenced by profiles. Editing a catalog definition updates every profile
that uses it; importing a client profile keeps its included resources local to
that profile until you add catalog resources.

For automatic email, configure a local sendmail-compatible mailer, or set
`ECCE_SENDMAIL` to its executable path. `ECCE_TUI_FROM` can set the sender
address. Create separate profiles or groups when local clients need a
`localhost` server URL and remote clients need a network-reachable server URL.

## 3. Start ECCE

```
Expand Down
16 changes: 11 additions & 5 deletions include/dsm/CTLSSocket.H
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// CTLSSocket.H -- TLS client socket (OpenSSL) for the https data server.
//
// Trust: if $ECCE_HOME/siteconfig/RemoteServer/server.pem exists, that
// certificate is the only trust anchor and the presented certificate must be
// identical to it (host name is not checked, so IP addresses and aliases
// work). Otherwise the system store is used and the host name is verified.
// There is no mode in which verification is skipped.
// Trust: a per-user certificate pin for this server origin takes precedence.
// The legacy $ECCE_HOME/siteconfig/RemoteServer/server.pem pin is the fallback.
// A pin requires an exact certificate match; without a pin, the system store
// and host name are verified. There is no mode in which verification is
// skipped.

#if !defined( __CTLSSOCKET_H )
#define __CTLSSOCKET_H
Expand Down Expand Up @@ -53,6 +53,12 @@ public :

// Path of the pinned certificate, or "" when the system store applies.
static string_type pinnedCertPath(void);
// Origin-specific pin, falling back to the legacy shared pin.
static string_type pinnedCertPath(const string_type& host, port_type port);
// Save a PEM certificate pin for one TLS origin. An empty PEM removes it.
static bool storePinnedCertificate(const string_type& host, port_type port,
const string_type& pem,
string_type& error);

private :
SSL_CTX * ctx_;
Expand Down
85 changes: 85 additions & 0 deletions include/util/JsonConfigurationProfile.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// Versioned, credential-free configuration profiles saved from Preferences.
#ifndef JSONCONFIGURATIONPROFILE_HH
#define JSONCONFIGURATIONPROFILE_HH

#include <string>
#include <vector>

namespace JsonConfigurationProfile {

struct DataServer {
std::string name;
std::string url;
std::string tlsCertificatePem;
std::string username;
};

struct Code {
std::string name;
std::string program;
std::vector<std::string> modules;
std::string setup;
std::string command;
std::string environment;
};

struct Queue {
std::string name;
unsigned int minProcessors;
unsigned int maxProcessors;
unsigned int maxCPU;
unsigned int maxMemory;
unsigned int minScratch;
unsigned int defProcessors;
unsigned int defRun;
unsigned int defMemory;
unsigned int defScratch;
std::string memUnits;
std::string requestLines;

Queue() : minProcessors(0), maxProcessors(0), maxCPU(0), maxMemory(0),
minScratch(0), defProcessors(0), defRun(0), defMemory(0),
defScratch(0) {}
};

struct Setting {
std::string name;
std::string value;
};

struct ComputeResource {
std::string name;
std::string host;
std::string vendor;
std::string model;
std::string processor;
unsigned int processors;
unsigned int nodes;
bool allocationAccounts;
std::string queueManager;
std::vector<Code> codes;
std::vector<Queue> queues;
std::vector<Setting> settings;

ComputeResource() : processors(0), nodes(0), allocationAccounts(false) {}
};

struct Profile {
unsigned int version;
std::vector<DataServer> dataServers;
std::vector<ComputeResource> computeResources;
std::vector<std::string> jobCreationCodes;

Profile() : version(2) {}
};

// Save atomically. The schema has no username or password fields; URLs with
// user-info and hosts containing a login prefix are rejected.
bool save(const std::string& path, const Profile& profile, std::string& error);

// Parse and validate without applying anything to ECCE preferences.
bool load(const std::string& path, Profile& profile, std::string& error);

} // namespace JsonConfigurationProfile

#endif
4 changes: 3 additions & 1 deletion include/util/ServerList.H
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* The servers a user has added (#767): SSH folders and ECCE servers, kept
* per user in one plain file, ~/.ECCE/AddedServers, one line per server:
*
* <type><TAB><name><TAB><address><TAB><connect-at-start: 0 or 1>
* <type><TAB><name><TAB><address><TAB><connect-at-start: 0 or 1><TAB><username>
*
* type is "ssh" (address sftp://user@host/folder) or "ecce" (address
* https://host[:port]). wx-free; Edit > Preferences > Data lists them.
Expand All @@ -24,6 +24,7 @@ struct ServerEntry
string name;
string address;
bool connectAtStart = false;
string username; // Optional login hint imported with a client profile.
};

class ServerList
Expand Down Expand Up @@ -61,6 +62,7 @@ class ServerList
static bool isAdded(const string& ref);
static void setLogin(const string& ref, const string& user); // "" forgets
static string loginFor(const string& ref);
static string usernameFor(const string& ref);
// The account whose home /Ecce/users/<account> is meant under url: an
// added server's own login ("" before it), else Ecce::serverUser().
static string userFor(const string& url);
Expand Down
4 changes: 4 additions & 0 deletions include/wxgui/GlobalPrefs.H
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ private:
void OnEditServer(wxCommandEvent& event);
void OnRemoveServer(wxCommandEvent& event);
void OnServerSelect(wxListEvent& event);
void OnSaveConfiguration(wxCommandEvent& event);
void OnLoadConfiguration(wxCommandEvent& event);
void updateServerButtons();
long selectedServer() const;
ProgramRow makeProgramRow(wxWindow* page, wxSizer* sizer,
Expand Down Expand Up @@ -173,6 +175,8 @@ private:
ewxButton* p_addServer;
ewxButton* p_editServer;
ewxButton* p_removeServer;
ewxButton* p_saveConfiguration;
ewxButton* p_loadConfiguration;

// Advanced page (#307): one row per EnvSwitches::all() entry.
struct AdvancedRow {
Expand Down
Loading
Loading