Skip to content

Commit

Permalink
prep for v0.0.10, Proof of concept
Browse files Browse the repository at this point in the history
  • Loading branch information
R. S. Doiel committed Oct 30, 2024
1 parent 13f5a6c commit 8cd52ba
Show file tree
Hide file tree
Showing 29 changed files with 146 additions and 122 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ PROJECT = cold

PACKAGE = $(shell ls -1 *.ts | grep -v 'version.ts')

PROGRAMS = ds_importer cold_admin directory_sync set_include_in_feeds reports
PROGRAMS = cold_admin cold_reports directory_sync

TS_MODS = cold_admin.ts ds_importer.ts directory_sync.ts
TS_MODS = cold_admin.ts cold_reports.ts directory_sync.ts

GIT_GROUP = caltechlibrary

Expand Down Expand Up @@ -50,7 +50,7 @@ compile: check $(TS_MODS)
deno task build
bin/cold_admin$(EXT) --help >cold_admin.1.md
bin/directory_sync$(EXT) --help >directory_sync.1.md
bin/reports$(EXT) --help >reports.1.md
bin/cold_reports$(EXT) --help >cold_reports.1.md

check: $(TS_MODS)
deno task check
Expand Down
2 changes: 1 addition & 1 deletion about.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<section>
<h1 id="about-this-software">About this software</h1>
<h2 id="cold-0.0.9">cold 0.0.9</h2>
<h2 id="cold-0.0.10">cold 0.0.10</h2>
<h3 id="authors">Authors</h3>
<ul>
<li>R. S. Doiel</li>
Expand Down
4 changes: 2 additions & 2 deletions cold_admin.1.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%cold(1) user manual | 0.0.10 2024-10-30 702a881
%cold(1) user manual | 0.0.10 2024-10-30 13f5a6c
% R. S.Doiel
% 2024-10-30 702a881
% 2024-10-30 13f5a6c

# NAME

Expand Down
51 changes: 27 additions & 24 deletions reports.1.html → cold_reports.1.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,33 @@

<section>
<h1 id="name">NAME</h1>
<p>directory_sync</p>
<p>cold_reports</p>
<h1 id="synopsis">SYNOPSIS</h1>
<p>directory_sync <a href="#options">OPTIONS</a> [REPORTS_YAML]</p>
<p>cold_reports <a href="#options">OPTIONS</a> [REPORTS_YAML]</p>
<h1 id="description">DESCRIPTION</h1>
<p>directory_sync processes the report quest queue. The directory_sync
is expected to validate the report request, launch the report passing to
it via standard input a JSON expression holding the request details. In
return directory_sync monitors the execution of the request and listens
in standard input for a JSON object describing the result then updates
the report request queue accordingly.</p>
<p>cold_reports processes the report request queue. cold_reports is
expected to validate the report request, launch the report. The report
is responsible to writing it’s output to standard out which is read by
the cold_reports. cold_reports then renders the report to a known
location and updates the link data in the report request record.</p>
<p>REPORTS_YAML is the filename to read for configuring which reports
are allowed to run and what programs are executed as a result. If it is
not provided then reports.yaml is looked for in the current working
directory.</p>
<p>directory_sync requires access to the COLD JSON API to manage report
not provided then “cold_reports.yaml is looked for in the current
working directory.</p>
<p>cold_reports requires access to the COLD JSON API to manage report
requests.</p>
<p>Reports are simply scripts or programs that read a JSON object form
standard input, render a report including storing it and determining the
URL where the report can be retrieved. When the report is completed then
it returns the JSON object it recieved updated with the eport status,
link information. It the responsible of the report to determine where
it’s results are stored (e.g. G-Drive, Box, etc). When the reports
results are recieved by the runner it will notify anyone in the email
list of the report results (e.g. report name, final status and
link).</p>
<p>directory_sync is designed as daemon suitable to run under systemd or
other service management system. Logging is written to standard
output.</p>
<p>Two example reports are provided in the COLD repository. Both are
written in Bash and require that dataset’s dsquery program are
available. The provided report examples are “run_people_csv.bash” and
“run_groups_csv.bash”.</p>
<p>Reports can be written in any langauge supported by the host system
or can be compiled programs. The primary requirement is that they write
their results to standard out so that the report runner can manage
making the reports available via the COLD web app.</p>
<p>cold_reports is designed as daemon suitable to run under systemd or
other service management system. Logging is written to standard output.
Included in the COLD repository is an example service file to use when
deploying cold_reports.</p>
<h1 id="options">OPTIONS</h1>
<dl>
<dt>help</dt>
Expand All @@ -71,7 +70,11 @@ <h1 id="options">OPTIONS</h1>
</dd>
</dl>
<h1 id="example">EXAMPLE</h1>
<pre class="shell"><code>directory_sync reports.yaml</code></pre>
<p>Shown is starting cold_reports with an explicit configuration file,
“my_cold_reports.yaml” file, then run with the default configuration
file, “cold_reports.yaml” in the same working directory.</p>
<pre class="shell"><code>cold_reports my_cold_reports.yaml
cold_reports</code></pre>
</section>

<footer>
Expand Down
63 changes: 63 additions & 0 deletions cold_reports.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
%cold_reports(1) user manual | 0.0.10 2024-10-30 13f5a6c
% R. S.Doiel
% 2024-10-30 13f5a6c

# NAME

cold_reports

# SYNOPSIS

cold_reports [OPTIONS] [REPORTS_YAML]

# DESCRIPTION

cold_reports processes the report request queue. cold_reports is expected to validate
the report request, launch the report. The report is responsible to writing it's output
to standard out which is read by the cold_reports. cold_reports then renders the report
to a known location and updates the link data in the report request record.

REPORTS_YAML is the filename to read for configuring which reports are allowed to run and
what programs are executed as a result. If it is not provided then "cold_reports.yaml" is looked
for in the current working directory.

cold_reports requires access to the COLD JSON API to manage report requests.

Two example reports are provided in the COLD repository. Both are written in Bash and
require that dataset's dsquery program are available. The provided report examples
are "run_people_csv.bash" and "run_groups_csv.bash".

Reports can be written in any langauge supported by the host system or can be
compiled programs. The primary requirement is that they write their results to standard
out so that the report runner can manage making the reports available via the COLD web app.

cold_reports is designed as daemon suitable to run under systemd or other service management
system. Logging is written to standard output. Included in the COLD repository is an example
service file to use when deploying cold_reports.

# OPTIONS

help
: display help

license
: display license

version
: display version

debug
: turn on debug logging


# EXAMPLE

Shown is starting cold_reports with an explicit configuration file, "my_cold_reports.yaml" file, then
run with the default configuration file, "cold_reports.yaml" in the same working directory.

~~~shell
cold_reports my_cold_reports.yaml
cold_reports
~~~


15 changes: 15 additions & 0 deletions cold_reports.service-example
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=COLD reports service
Documentation=man:cold_reports(1)
After=network.target
ConditionPathExists=!/Sites/cold/cold_not_to_be_run

[Service]
WorkingDirectory=/Sites/cold
ExecStart=/Sites/cold/bin/cold_reports
Type=simple
Restart=always

[Install]
WantedBy=multi-user.target
Alias=cold_reports.service
37 changes: 20 additions & 17 deletions reports.ts → cold_reports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const wait_in_seconds = 0;
* @param {[k: string]: string} helpOpt holds the help options defined for the app.
*/
function helpText(helpOpt: { [k: string]: string }): string {
const app_name = "directory_sync";
const app_name = "cold_reports";
const version = appInfo.version;
const release_date = appInfo.releaseDate;
const release_hash = appInfo.releaseHash;
Expand All @@ -44,28 +44,28 @@ ${app_name} [OPTIONS] [REPORTS_YAML]
# DESCRIPTION
${app_name} processes the report quest queue. The ${app_name} is expected to validate
the report request, launch the report passing to it via standard input a JSON expression
holding the request details. In return ${app_name} monitors the execution of the request
and listens in standard input for a JSON object describing the result then updates the
report request queue accordingly.
${app_name} processes the report request queue. ${app_name} is expected to validate
the report request, launch the report. The report is responsible to writing it's output
to standard out which is read by the ${app_name}. ${app_name} then renders the report
to a known location and updates the link data in the report request record.
REPORTS_YAML is the filename to read for configuring which reports are allowed to run and
what programs are executed as a result. If it is not provided then reports.yaml is looked
what programs are executed as a result. If it is not provided then "cold_reports.yaml" is looked
for in the current working directory.
${app_name} requires access to the COLD JSON API to manage report requests.
Reports are simply scripts or programs that read a JSON object form standard input,
render a report including storing it and determining the URL where the report can
be retrieved. When the report is completed then it returns the JSON object it recieved
updated with the eport status, link information. It the responsible of the report to
determine where it's results are stored (e.g. G-Drive, Box, etc). When the reports
results are recieved by the runner it will notify anyone in the email list of the
report results (e.g. report name, final status and link).
Two example reports are provided in the COLD repository. Both are written in Bash and
require that dataset's dsquery program are available. The provided report examples
are "run_people_csv.bash" and "run_groups_csv.bash".
Reports can be written in any langauge supported by the host system or can be
compiled programs. The primary requirement is that they write their results to standard
out so that the report runner can manage making the reports available via the COLD web app.
${app_name} is designed as daemon suitable to run under systemd or other service management
system. Logging is written to standard output.
system. Logging is written to standard output. Included in the COLD repository is an example
service file to use when deploying ${app_name}.
# OPTIONS
`,
Expand All @@ -80,9 +80,12 @@ system. Logging is written to standard output.
txt.push(`
# EXAMPLE
Shown is starting ${app_name} with an explicit configuration file, "my_cold_reports.yaml" file, then
run with the default configuration file, "cold_reports.yaml" in the same working directory.
~~~shell
${app_name} reports.yaml
${app_name} my_cold_reports.yaml
${app_name}
~~~
`);
Expand Down Expand Up @@ -589,7 +592,7 @@ async function main(): Promise<void> {
? args.shift() as unknown as string
: "";
if (config_yaml === "") {
config_yaml = "reports.yaml";
config_yaml = "cold_reports.yaml";
}
// Start up the service.
setInterval(
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
"cold_api": "datasetd cold_api.yaml",
"cold_api_debug": "datasetd --debug cold_api.yaml",
"cold": "deno run --watch --allow-import --allow-read --allow-net --watch cold_admin.ts --htdocs=./htdocs",
"cold_reports": "deno run --watch --allow-all reports.ts",
"cold_reports": "deno run --watch --allow-all cold_reports.ts",
"reset_data": "dsquery groups.ds 'delete from groups' ; dsquery people.ds 'delete from people' ; dsquery funders.ds 'delete from funders' ; dsquery issn.ds 'delete from issn'",
"load_data": "deno task import_groups_csv ; deno task import_people_csv ; deno task import_issn_journal_publisher_csv",
"reload_data": "deno task reset_data ; deno task load_data",
"test_dataset": "dsquery test.ds 'delete from test' ; deno test --allow-net dataset_test.ts",
"check": "deno check --allow-import cold_admin.ts ; deno check --allow-import ds_importer.ts ; deno check --allow-import directory_sync.ts ; deno check --allow-import reports.ts",
"check": "deno check --allow-import cold_admin.ts ; deno check --allow-import ds_importer.ts ; deno check --allow-import directory_sync.ts ; deno check --allow-import cold_reports.ts",
"dev": "deno run --allow-import --allow-read --allow-net --watch cold_admin.ts --htdocs=./htdocs",
"reload_dev": "deno run --allow-import --allow-read --allow-net --reload --write-lock --watch cold_admin.ts --htdocs=./htdocs",
"start": "deno run --allow-read --allow-net cold_admin.ts",
"build": "deno compile --allow-import --allow-read --allow-net --output bin/cold_admin cold_admin.ts ; deno compile --allow-import --allow-read --allow-net --output bin/ds_importer ds_importer.ts ; deno compile --allow-import --allow-read --allow-net --output bin/directory_sync directory_sync.ts ; deno compile --allow-import --allow-read --allow-net --output bin/set_include_in_feeds set_include_in_feeds.ts ; deno compile --allow-all --output bin/reports reports.ts",
"build": "deno compile --allow-import --allow-read --allow-net --output bin/cold_admin cold_admin.ts ; deno compile --allow-import --allow-read --allow-net --output bin/directory_sync directory_sync.ts ; deno compile --allow-all --output bin/cold_reports cold_reports.ts",
"htdocs": "deno run --allow-import --allow-read --allow-write=htdocs build.ts",
"test": "dsquery test.ds 'delete from test' ; deno test --allow-net dataset_test.ts ; deno test options_test.ts ; deno test config_test.ts ; deno test people_test.ts ; deno test groups_test.ts ; deno test cold_admin_test.ts ",
"import_people_csv": "deno run --allow-import --allow-read --allow-net ds_importer.ts people.ds people.csv",
Expand Down
4 changes: 2 additions & 2 deletions deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ export { sleepRandomAmountOfSeconds } from "https://deno.land/x/sleep/mod.ts"
export { directoryUrl } from "./directory_config.ts";
export { directoryLookup, DirectoryRecord } from "./directory_api.ts";
export type { DirectoryRecordInterface } from "./directory_api.ts";
export { handleReports } from "./reports.ts";
export type { ReportInterface, Report } from "./reports.ts";
export { handleReports } from "./cold_reports.ts";
export type { ReportInterface, Report } from "./cold_reports.ts";
4 changes: 2 additions & 2 deletions directory_sync.1.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%directory_sync(1) user manual | 0.0.10 2024-10-30 702a881
%directory_sync(1) user manual | 0.0.10 2024-10-30 13f5a6c
% R. S.Doiel
% 2024-10-30 702a881
% 2024-10-30 13f5a6c

# NAME

Expand Down
Binary file added pagefind/fragment/en-US_15a161e.pf_fragment
Binary file not shown.
Binary file added pagefind/fragment/en-US_363ba2d.pf_fragment
Binary file not shown.
Binary file added pagefind/fragment/en-US_62c5bfe.pf_fragment
Binary file not shown.
Binary file added pagefind/fragment/en-US_71564e8.pf_fragment
Binary file not shown.
Binary file added pagefind/fragment/en-US_b850f78.pf_fragment
Binary file not shown.
Binary file added pagefind/fragment/en-US_fc2faef.pf_fragment
Binary file not shown.
Binary file added pagefind/index/en-US_a660bee.pf_index
Binary file not shown.
Binary file added pagefind/index/en-US_c68cf8d.pf_index
Binary file not shown.
Binary file added pagefind/index/en-US_d2e1f92.pf_index
Binary file not shown.
2 changes: 1 addition & 1 deletion pagefind/pagefind-entry.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"1.1.1","languages":{"en-US":{"hash":"en-US_93c527e8577f4","wasm":"en-US","page_count":13}}}
{"version":"1.1.1","languages":{"en-US":{"hash":"en-US_76e012f0e4b37","wasm":"en-US","page_count":13}}}
Binary file added pagefind/pagefind.en-US_45b6fec9d1e87.pf_meta
Binary file not shown.
Binary file added pagefind/pagefind.en-US_65bb6c7bcaaa5.pf_meta
Binary file not shown.
Binary file added pagefind/pagefind.en-US_76e012f0e4b37.pf_meta
Binary file not shown.
10 changes: 4 additions & 6 deletions release.bash
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
#!/bin/bash

#
# Generate a new draft release using Make and gh
# Generate a new draft release jq and gh
#
make
make website
make release
RELEASE_TAG="v$(jq -r .version codemeta.json)"
RELEASE_NOTES="$(jq .releaseNotes codemeta.json)"
RELEASE_NOTES="$(jq -r .releaseNotes codemeta.json)"
make save msg="prep for ${RELEASE_TAG}, ${RELEASE_NOTES}"
# Now generate a draft releas
gh release create "${RELEASE_TAG}" \
--verify-tag --draft \
--draft \
--notes="${RELEASE_NOTES}" \
dist/*.zip
echo "Now goto repo release and finalize draft"
60 changes: 0 additions & 60 deletions reports.1.md

This file was deleted.

1 change: 1 addition & 0 deletions user_manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ <h2 id="public-interface">Public Interface</h2>
<li><a href="INSTALL.html">Installation</a></li>
<li><a href="deployment.html">deployments</a></li>
<li><a href="cold_admin.1.html">cold_admin</a> (man page)</li>
<li><a href="cold_reports.1.html">cold_reports</a> (man page)</li>
<li><a href="directory_sync.1.html">directory_sync</a> (man page)</li>
<li><a href="development_notes.html">devemopment notes</a></li>
</ul>
Expand Down
Loading

0 comments on commit 8cd52ba

Please sign in to comment.