Commit Graph

1090 Commits

Author SHA1 Message Date
5c275aa622 Defensively handle errors examining app requests. (#922)
Related to cerc-io/webapp-deployment-status-api#10

There are two issues in that.  One is that the output probably changed recently, whether in the client or server, where no matching record is found by ID (Note this is specific to `laconic record get --id <v>` and does not seem to apply to the similar command to retrieve a record by name, `laconic name resolve <n>`).

Rather than returning `[]` it is now returning `[ null ]`.  This cause us to think there *was* an application record found, and we attempt to treat the `null` entry like an Application object.  That's fixed by filtering out null responses, which is a good precaution for the deployer, though I think it makes sense to ask whether this new behavior by the client/server is correct.  Seems suspicious.

The other issue is that all the defensive checks we had in place to deal with broken/bad AppDeploymentRequests were around the _build_.  This error was coming much earlier, merely when parsing and examining the request to see if it needed to be handled at all.

I have now added similar defensive error handling around that portion of the code.

Reviewed-on: cerc-io/stack-orchestrator#922
Reviewed-by: zramsay <zramsay@noreply.git.vdb.to>
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2024-08-14 18:04:31 +00:00
8576137557 Convert port to string. (#919)
The str type check doesn't work if the port is a ruamel.yaml.scalarstring.SingleQuotedScalarString or ruamel.yaml.scalarstring.DoubleQuotedScalarString

Reviewed-on: cerc-io/stack-orchestrator#919
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2024-08-14 00:25:35 +00:00
65c1cdf6b1 Fix crash if port has int type in yaml (#918)
Reviewed-on: cerc-io/stack-orchestrator#918
Reviewed-by: Thomas E Lackey <telackey@noreply.git.vdb.to>
Co-authored-by: David Boreham <david@bozemanpass.com>
Co-committed-by: David Boreham <david@bozemanpass.com>
2024-08-13 20:47:09 +00:00
265699bc38 Allow to disable kind cluster management for testing (#915)
Reviewed-on: cerc-io/stack-orchestrator#915
Co-authored-by: David Boreham <david@bozemanpass.com>
Co-committed-by: David Boreham <david@bozemanpass.com>
2024-08-13 17:48:14 +00:00
4a7670a5d6 Open the json-rpc port (#916)
Reviewed-on: cerc-io/stack-orchestrator#916
Co-authored-by: David Boreham <david@bozemanpass.com>
Co-committed-by: David Boreham <david@bozemanpass.com>
2024-08-13 17:47:56 +00:00
6087e1cd31 Copy config under a volume for Docker (similar to a ConfigMap for K8S). (#914)
This emulates the K8S ConfigMap behavior on Docker by using a regular volume.

If a directory exists under `config/` which matches a named volume, the contents will be copied to the volume on `create` (provided the destination volume is empty).  That is, rather than a ConfigMap, it is essentially a "config volume".

For example, with a compose file like:

```
version: '3.7'
services:
  caddy:
    image: cerc/caddy-ethcache:local
    restart: always
    volumes:
      - caddyconfig:/etc/caddy:ro
volumes:
  caddyconfig:
```

And a directory:

```
❯ ls stack-orchestrator/config/caddyconfig/
Caddyfile
```

After `laconic-so deploy create --spec-file caddy.yml --deployment-dir /srv/caddy` there will be:

```
❯ ls /srv/caddy/data/caddyconfig
Caddyfile
```

Mounted at `/etc/caddy`

Reviewed-on: cerc-io/stack-orchestrator#914
Reviewed-by: David Boreham <dboreham@noreply.git.vdb.to>
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2024-08-10 02:32:21 +00:00
1def279d26 Support multiple NodePorts, static NodePort mapping, and add 'replicas' spec option (#913)
NodePort example:

```
network:
  ports:
    caddy:
     - 1234
     - 32020:2020
```

Replicas example:

```
replicas: 2
```

This also adds an optimization for k8s where if a directory matching the name of a configmap exists in beneath config/ in the stack, its contents will be copied into the corresponding configmap.

For example:

```
# Config files in the stack
❯ ls stack-orchestrator/config/caddyconfig
Caddyfile  Caddyfile.one-req-per-upstream-example

# ConfigMap in the spec
❯ cat foo.yml | grep config
...
configmaps:
  caddyconfig: ./configmaps/caddyconfig

# Create the deployment
❯ laconic-so --stack ~/cerc/caddy-ethcache/stack-orchestrator/stacks/caddy-ethcache deploy create --spec-file foo.yml

# The files from beneath config/<config_map_name> have been copied to the ConfigMap directory from the spec.
❯ ls deployment-001/configmaps/caddyconfig
Caddyfile  Caddyfile.one-req-per-upstream-example
```

Reviewed-on: cerc-io/stack-orchestrator#913
Reviewed-by: David Boreham <dboreham@noreply.git.vdb.to>
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2024-08-09 02:32:06 +00:00
64691bd206 Merge pull request 'Allow gentx-files to be omitted' (#911) from dboreham/allow-zero-gentx into main
Reviewed-on: cerc-io/stack-orchestrator#911
2024-08-07 20:13:40 +00:00
aef5986135 Allow gentx-files to be omitted 2024-08-07 14:11:06 -06:00
6f8f0340d3 Merge pull request 'Add stage 1 support' (#910) from dboreham/stage1-support into main
Reviewed-on: cerc-io/stack-orchestrator#910
2024-08-07 17:44:28 +00:00
7590d6e237 Add stage 1 support 2024-08-07 11:28:10 -06:00
573f99dbbe Listen on 0.0.0.0 (#909)
Reviewed-on: cerc-io/stack-orchestrator#909
Co-authored-by: David Boreham <david@bozemanpass.com>
Co-committed-by: David Boreham <david@bozemanpass.com>
2024-08-02 14:06:06 +00:00
8052c1c25e Merge pull request 'Laconicd needs to be told its currency' (#908) from dboreham/mainnet-laconic-specify-currency into main
Reviewed-on: cerc-io/stack-orchestrator#908
2024-08-02 03:10:34 +00:00
a674d13493 Laconicd needs to be told its currency 2024-08-01 21:09:30 -06:00
0d4f4509c8 Remove Eth fixturenet workflows (#906)
Deletes the now-failing CI workflows for the old `fixturenet-eth` and `fixturenet-plugeth` stacks.

Part of cerc-io/stack-orchestrator#905.

Reviewed-on: cerc-io/stack-orchestrator#906
Reviewed-by: David Boreham <dboreham@noreply.git.vdb.to>
2024-08-01 02:28:05 +00:00
5af27b1b3a Merge pull request 'Fix for sh as shell not bash' (#907) from dboreham/fix-script-for-ubuntu into main
Reviewed-on: cerc-io/stack-orchestrator#907
2024-07-31 20:39:37 +00:00
6c91b87348 Fix for sh as shell not bash 2024-07-31 14:30:53 -06:00
7d18334953 Mainnet-laconic stack fixes for laconicd2 (#904)
Reviewed-on: cerc-io/stack-orchestrator#904
2024-07-31 13:51:28 +00:00
79c1c5ed99 Update fixturenet-laconicd stack to use alnt denom (#902)
Part of [laconicd testnet validator enrollment](https://www.notion.so/laconicd-testnet-validator-enrollment-6fc1d3cafcc64fef8c5ed3affa27c675)

Reviewed-on: cerc-io/stack-orchestrator#902
Reviewed-by: ashwin <ashwin@noreply.git.vdb.to>
Reviewed-by: David Boreham <dboreham@noreply.git.vdb.to>
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-07-31 13:27:54 +00:00
dfedd9e9ff rename laconic-sdk to registry-sdk (#897)
Co-authored-by: zramsay <zach@bluecollarcoding.ca>
Reviewed-on: cerc-io/stack-orchestrator#897
Reviewed-by: ashwin <ashwin@noreply.git.vdb.to>
Co-authored-by: zramsay <zramsay@noreply.git.vdb.to>
Co-committed-by: zramsay <zramsay@noreply.git.vdb.to>
2024-07-31 08:01:02 +00:00
f64683f03b Use a more flexible mechanism to inject config into next.config.js for runtime env. (#901)
Instead of attempting to rewriting the nextConfig file directly, inject a helper function to add the config we need.

Reviewed-on: cerc-io/stack-orchestrator#901
Reviewed-by: David Boreham <dboreham@noreply.git.vdb.to>
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2024-07-31 03:22:23 +00:00
913c3a8557 Back to v2 now that we have a working webapp deployer build again. (#896)
Reviewed-on: cerc-io/stack-orchestrator#896
Reviewed-by: David Boreham <dboreham@noreply.git.vdb.to>
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2024-07-27 18:59:42 +00:00
2f5b0cdd13 Revert recent laconicd deployment changes to restore production webapp deployer function. (#895)
Reviewed-on: cerc-io/stack-orchestrator#895
2024-07-27 17:04:03 +00:00
432bd4113d 881: Support next.config.mjs (#890)
Reviewed-on: cerc-io/stack-orchestrator#890
2024-07-25 16:47:17 +00:00
b26698b756 Update fixturenet-laconicd stack for renaming changes (#891)
Part of [Rename laconic2d to laconicd](https://www.notion.so/Rename-laconic2d-to-laconicd-9028d0c020d24d1288e92ebcb773d7a7)
Handles cerc-io/stack-orchestrator#882, cerc-io/stack-orchestrator#889

Reviewed-on: cerc-io/stack-orchestrator#891
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-07-25 08:50:15 +00:00
01deac78c4 880: Support new compile/generate syntax for next >=14.2.0 (#886)
Fix for cerc-io/stack-orchestrator#880 to support the next compile/generate syntax.

Reviewed-on: cerc-io/stack-orchestrator#886
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2024-07-24 20:20:16 +00:00
40ccd47857 Merge pull request 'fixes for deployer & SP documentation' (#887) from zach/cns-to-registry into main
Reviewed-on: cerc-io/stack-orchestrator#887
2024-07-24 00:29:14 +00:00
zramsay
80cff73344 crn --> lrn 2024-07-23 20:20:01 -04:00
zramsay
21b1270d27 fix lint 2024-07-23 20:16:16 -04:00
zramsay
008389dcd8 cns --> registry and other fixes 2024-07-23 20:10:06 -04:00
c81fb9581a Fix stack path check (#877)
Reviewed-on: cerc-io/stack-orchestrator#877
Co-authored-by: David Boreham <david@bozemanpass.com>
Co-committed-by: David Boreham <david@bozemanpass.com>
2024-07-19 17:16:40 +00:00
83397bbae4 Enable cors in laconicd http services (#875)
Reviewed-on: cerc-io/stack-orchestrator#875
Co-authored-by: David Boreham <david@bozemanpass.com>
Co-committed-by: David Boreham <david@bozemanpass.com>
2024-07-15 05:23:18 +00:00
17c21464ab Merge pull request 'Work around explorer host name sensitivity' (#874) from dboreham/fix-explorer-testnet-hostname into main
Reviewed-on: cerc-io/stack-orchestrator#874
2024-07-15 02:56:33 +00:00
7fb9ccdfd8 Work around explorer host name sensitivity 2024-07-14 20:51:11 -06:00
2bad59dfcd Add missing file to explorer container (#873)
Reviewed-on: cerc-io/stack-orchestrator#873
Co-authored-by: David Boreham <david@bozemanpass.com>
Co-committed-by: David Boreham <david@bozemanpass.com>
2024-07-14 17:40:35 +00:00
13d04e9256 Integrate ping-pub explorer (#872)
Reviewed-on: cerc-io/stack-orchestrator#872
2024-07-13 14:24:23 +00:00
1f017c9066 increase CERC_MAX_GENERATE_TIME for webapps (#857)
sort of addresses #856

Co-authored-by: zramsay <zach@bluecollarcoding.ca>
Co-authored-by: David Boreham <dboreham@noreply.git.vdb.to>
Reviewed-on: cerc-io/stack-orchestrator#857
Co-authored-by: zramsay <zramsay@noreply.git.vdb.to>
Co-committed-by: zramsay <zramsay@noreply.git.vdb.to>
2024-07-12 19:01:35 +00:00
3b9422095c Add support for bun as a webapp package manager (#800)
This is working off pull request "[Add support for pnpm as a webapp build tool. #767](https://git.vdb.to/cerc-io/stack-orchestrator/pulls/767/files)" that adds `pnpm` package manager support for `nextjs` & `webapps`.

`bun` default build output directory (defined as `CERC_BUILD_OUTPUT_DIR`) is `dist` which should already be handled with `pnpm` support in the previously mentioned [pull request](https://git.vdb.to/cerc-io/stack-orchestrator/pulls/767/files)

Installing `bun` using `npm` following our previous `pnpm` installation

```zsh
npm install -g bun
```

We'll be using `bun` as a package manager that works with `Node.js` projects as defined in bun's [docs](https://bun.sh/docs/cli/install)

> The bun CLI contains a Node.js-compatible package manager designed to be a dramatically faster replacement for npm, yarn, and pnpm. It's a standalone tool that will work in pre-existing Node.js projects; if your project has a package.json, bun install can help you speed up your workflow.

To test `next.js` apps using `node.js` and compatibility with all four packager managers -- `npm`, `yarn`, `pnpm`, and `bun` -- use the branches of snowball's [nextjs-package-manager-example-app](https://git.vdb.to/snowball/nextjs-package-manager-example-app) repo: `nextjs-package-manager/npm`, `nextjs-package-manager/yarn`, `nextjs-package-manager/pnpm`, `nextjs-package-manager/bun`.

Co-authored-by: Vivian Phung <dev+github@vivianphung.com>
Co-authored-by: David Boreham <dboreham@noreply.git.vdb.to>
Reviewed-on: https://git.vdb.to/cerc-io/stack-orchestrator/pulls/800
Reviewed-by: David Boreham <dboreham@noreply.git.vdb.to>
Co-authored-by: VPhung24 <vphung24@noreply.git.vdb.to>
Co-committed-by: VPhung24 <vphung24@noreply.git.vdb.to>
2024-07-09 18:00:14 +00:00
36d4969b2d Fixes for external stack deployment (#851)
Fixes
- stack path resolution for `build`
- external stack path resolution for deployments
- "extra" config detection
- `deployment ports` command
- `version` command in dist or source install (without build_tag.txt)
- `setup-repos`, so it won't die when an existing repo is not at a branch or exact tag

Used in cerc-io/fixturenet-eth-stacks#14

Reviewed-on: cerc-io/stack-orchestrator#851
Reviewed-by: David Boreham <dboreham@noreply.git.vdb.to>
2024-07-09 15:37:35 +00:00
a2d6201be9 Merge pull request 'Remove quotes from git config' (#870) from dboreham/fix-git-config-command into main
Reviewed-on: cerc-io/stack-orchestrator#870
2024-07-05 15:56:12 +00:00
62f7825ec2 Remove quotes from git config 2024-07-05 09:55:14 -06:00
6d24d4a7e6 Set github auth token if present (#868)
Reviewed-on: cerc-io/stack-orchestrator#868
Co-authored-by: David Boreham <david@bozemanpass.com>
Co-committed-by: David Boreham <david@bozemanpass.com>
2024-07-05 12:27:22 +00:00
f06e5f9a2a Don't try to tag remote images (#866)
Reviewed-on: cerc-io/stack-orchestrator#866
Co-authored-by: David Boreham <david@bozemanpass.com>
Co-committed-by: David Boreham <david@bozemanpass.com>
2024-07-04 23:51:06 +00:00
c3a1402042 Derive the webapp host container id from stable data (#865)
Reviewed-on: cerc-io/stack-orchestrator#865
Co-authored-by: David Boreham <david@bozemanpass.com>
Co-committed-by: David Boreham <david@bozemanpass.com>
2024-07-04 22:38:07 +00:00
ca5fffaed5 Add logging to webapp deployer (#863)
Helps with diagnosing failures and odd behavior seen in the deployer in production.

Reviewed-on: cerc-io/stack-orchestrator#863
Co-authored-by: David Boreham <david@bozemanpass.com>
Co-committed-by: David Boreham <david@bozemanpass.com>
2024-07-04 19:46:42 +00:00
df776c1b4c Install git for apps that want to get their commit sha (#854)
Reviewed-on: cerc-io/stack-orchestrator#854
Reviewed-by: Thomas E Lackey <telackey@noreply.git.vdb.to>
Co-authored-by: David Boreham <dboreham@noreply.git.vdb.to>
Co-committed-by: David Boreham <dboreham@noreply.git.vdb.to>
2024-06-25 05:03:49 +00:00
48a3e79e6a Merge pull request 'Fix argument errors in command code' (#853) from dboreham/fix-laconic-mainnet-command into main
Reviewed-on: cerc-io/stack-orchestrator#853
2024-06-24 20:21:08 +00:00
0eaa5b8f09 Fix argument errors in command code 2024-06-24 14:15:46 -06:00
8980ac2581 Merge pull request 'Fixes for current SO objects' (#852) from dboreham/fix-mainnet-laconic into main
Reviewed-on: cerc-io/stack-orchestrator#852
2024-06-24 19:54:04 +00:00
fd15252c3f Fixes for current SO objects 2024-06-24 13:41:15 -06:00