Skip to content

v0.0.10

Choose a tag to compare

@rsdoiel rsdoiel released this 02 Oct 22:10
· 32 commits to main since this release

v0.0.10 takes clasm's command line from two scriptable actions to 23 of its 58 menu actions, makes the destructive ones safe to script, and fixes several things found by running clasm against real instances.

Command-line forms. Every domain now has a slug, and these actions run non-interactively: Compute (show-instances, show-amis, show-launch-templates, the instance, AMI and launch template detail views, show-export-cloud-init-for-an-instance-or-ami, create-launch-template-from-cloud-init-yaml, create-ec2-instance-from-launch-template), Key Management (show-key-pairs), IAM (the roles, instance profiles and policies listings and the role and instance profile details), S3 (show-buckets), Tag Management (show-all-tags ), Configuration (show-current-config), and RDM Backup & Restore (Generate SQL Backup, Restore SQL Backup and Restore OpenSearch Snapshot, beside the two archive forms from v0.0.9). Listings take -text (the default), -json or -jsonl; details take -text or -json. The command line is experimental: names and JSON keys may still change. The two destructive Restore forms share one gate: a dry run by default that prints the plan and changes nothing, and --confirm <instance-id-or-name> to run it without a prompt (DR-0180). The editors and Save in Configure stay interactive.

Launch templates. Instances launched from a template made by "Create launch template from cloud-init YAML" now carry a templateName tag with the template's name (issue #1). A new instance's output also shows the aws ssm start-session command beside the ssh example, with or without a public address.

Reading an AMI's cloud-init never worked before this release, for two independent reasons, both fixed. The temporary instance launched into the VPC default security group, which here has no outbound rules, so its SSM agent never registered; it now takes a group (cloud_init_extraction_security_groups, one per region, with a Configure editor that lists each region's groups and marks which allow outbound HTTPS, or -security-group on the command line) and refuses a group with no outbound port 443 before launching anything. And it read the new instance's empty user-data instead of the AMI source's gzipped one. cloud-init finishing "degraded" (warnings only) is no longer reported as an error, and a real error now shows cloud-init's own text.

Restore SQL Backup loads about twenty times faster (synchronous_commit=off for the load session only: 5.2 GB in 9 minutes 27 seconds, against about five hours), and removes its two scratch files, about 6.2 GB for production's database, once the table count is verified; a failed restore keeps them. Restore OpenSearch Snapshot now moves stale repository files aside, handles data streams, stops on an empty source, and deletes live indices only after the source is verified. Generate SQL Backup needs Docker rather than the AWS CLI and shows pg_dump's own error. Archive OpenSearch repairs ownership below the top of its repository directory, and only where that directory looks like a snapshot repository.

Backup directories. Generate SQL Backup never changes an existing directory's owner, group or mode: it creates a missing one as ubuntu:www-data 0770 and hands only the new dump to the service user, in the directory's own group, mode 0664 (DR-0183). The cron that writes the nightly dumps on the production RDM hosts runs as a member of www-data, not as ubuntu, so re-owning the directory would lock it out.

The documentation site is now built in GitHub Actions from docs/ with the shared caltechlibrary/workflows (the first run published successfully). make website and the committed HTML are gone; make, make release and release.bash do not depend on GitHub Actions.

Note on verification. Verified against real AWS: the two archive forms, both Restore forms and the shared gate on caltechauthors-test-v13 (a confirmed Restore SQL of production's dump, scratch files removed); every read-only form; the create-launch-template and create-instance forms; reading cloud-init from both AMIs in this account; Sync and Modify Size against a scratch launch template; the OpenSearch ownership repair; the Generate SQL Backup directory behaviour (an existing root:www-data 0770 directory left unchanged and the new dump handed over as ubuntu:www-data 0664, on caltechauthors-test-v13); the documentation workflow on GitHub. Not verified: the interactive pickers (their prompts were exercised in accessible mode, not the full-screen terminal); the AWS CLI install added to four cloud-init files, which has been checked statically but not by a boot.

Full Changelog: v0.0.9...v0.0.10