From 52fcd8c78e194c937bbb74c12935fb4f4463783b Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 13:42:12 -0400 Subject: [PATCH 01/25] try removing file --- k8s/root.test.w | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 k8s/root.test.w diff --git a/k8s/root.test.w b/k8s/root.test.w deleted file mode 100644 index cd283741..00000000 --- a/k8s/root.test.w +++ /dev/null @@ -1,6 +0,0 @@ -// Check that the app has a valid root -// (regression test for https://github.com/winglang/wing/issues/6806) -bring expect; - -let root = nodeof(this).root; -expect.equal(nodeof(root).path, "Default/Default/Default"); From 38b9b2af8150265da24cde630a2b3abab2d1e6ce Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 13:45:31 -0400 Subject: [PATCH 02/25] trying stuff --- k8s/test.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/k8s/test.sh b/k8s/test.sh index 4264c2f9..379fb1e6 100755 --- a/k8s/test.sh +++ b/k8s/test.sh @@ -25,10 +25,3 @@ t() { t examples/nodejs.main.w t examples/ubuntu.main.w - -WING_K8S_LABELS='{"app":"bang-bang", "fang": "fang"}' \ - WING_K8S_NAMESPACE=flanging \ - t examples/api-object.main.w - -echo "compiling all test files..." -wing compile -t ./lib/index.js *.test.w From c6322bae4e5da89584d3a473e41d9aaf16ac6d19 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 13:47:16 -0400 Subject: [PATCH 03/25] remove empty bin --- k8s/bin/kwing | 1 - 1 file changed, 1 deletion(-) delete mode 100644 k8s/bin/kwing diff --git a/k8s/bin/kwing b/k8s/bin/kwing deleted file mode 100644 index 1a248525..00000000 --- a/k8s/bin/kwing +++ /dev/null @@ -1 +0,0 @@ -#!/bin/sh From cf14490a5dbc389aae4f898597746dde3779ed42 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 13:50:20 -0400 Subject: [PATCH 04/25] remove tests --- k8s/test.sh | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/k8s/test.sh b/k8s/test.sh index 379fb1e6..fed6ee9b 100755 --- a/k8s/test.sh +++ b/k8s/test.sh @@ -1,27 +1,2 @@ #!/bin/sh -t() { - echo "$1 ================" - out=$(wing compile -t ./lib/index.js $1) - - cat $out/*.yaml > $1.actual.snap - cat $1.actual.snap - - if [ -f "$1.snap" ]; then - diff $1.snap $1.actual.snap - if [ $? -eq 0 ]; then - echo "$1: passed" - else - echo "$1: failed, updating snapshot" - cp $1.actual.snap $1.snap - rm $1.actual.snap - exit 1 - fi - else - cp $1.actual.snap $1.snap - fi - - rm $1.actual.snap -} - -t examples/nodejs.main.w -t examples/ubuntu.main.w +echo Done From 248c597caf40dbc49399beb608f0f77e0e056901 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 13:54:22 -0400 Subject: [PATCH 05/25] try removing examples --- k8s/examples/api-object.main.w | 14 ----- k8s/examples/api-object.main.w.snap | 11 ---- k8s/examples/nodejs-app/index.js | 1 - k8s/examples/nodejs.main.w | 29 ---------- k8s/examples/nodejs.main.w.snap | 85 ----------------------------- k8s/examples/ubuntu.main.w | 4 -- k8s/examples/ubuntu.main.w.snap | 46 ---------------- 7 files changed, 190 deletions(-) delete mode 100644 k8s/examples/api-object.main.w delete mode 100644 k8s/examples/api-object.main.w.snap delete mode 100644 k8s/examples/nodejs-app/index.js delete mode 100644 k8s/examples/nodejs.main.w delete mode 100644 k8s/examples/nodejs.main.w.snap delete mode 100644 k8s/examples/ubuntu.main.w delete mode 100644 k8s/examples/ubuntu.main.w.snap diff --git a/k8s/examples/api-object.main.w b/k8s/examples/api-object.main.w deleted file mode 100644 index c0340cfd..00000000 --- a/k8s/examples/api-object.main.w +++ /dev/null @@ -1,14 +0,0 @@ -bring ".." as k8s; - -new k8s.ApiObject( - apiVersion: "v1", - kind: "ConfigMap", - metadata: { - name: "your-config", - }, - spec: { - data: { - "key": "value", - }, - }, -); diff --git a/k8s/examples/api-object.main.w.snap b/k8s/examples/api-object.main.w.snap deleted file mode 100644 index a9625a68..00000000 --- a/k8s/examples/api-object.main.w.snap +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - labels: - app: bang-bang - fang: fang - name: your-config - namespace: flanging -spec: - data: - key: value diff --git a/k8s/examples/nodejs-app/index.js b/k8s/examples/nodejs-app/index.js deleted file mode 100644 index 43a92c1d..00000000 --- a/k8s/examples/nodejs-app/index.js +++ /dev/null @@ -1 +0,0 @@ -console.log("hello, k8s"); \ No newline at end of file diff --git a/k8s/examples/nodejs.main.w b/k8s/examples/nodejs.main.w deleted file mode 100644 index af902ce0..00000000 --- a/k8s/examples/nodejs.main.w +++ /dev/null @@ -1,29 +0,0 @@ -bring "cdk8s-plus-27" as k8s; -bring fs; - -// lets create a volume that contains our app. -let appData = new k8s.ConfigMap(); -appData.addDirectory(fs.join(@dirname, "nodejs-app")); - -let appVolume = k8s.Volume.fromConfigMap(this, "App", appData); - -// lets create a deployment to run a few instances of a pod -let deployment = new k8s.Deployment( - replicas: 3, -); - -// now we create a container that runs our app -let appPath = "/var/lib/app"; -let port = 80; -let container = deployment.addContainer({ - image: "node:14.4.0-alpine3.12", - command: ["node", "index.js", "{port}"], - port: port, - workingDir: appPath, -}); - -// make the app accessible to the container -container.mount(appPath, appVolume); - -// finally, we expose the deployment as a load balancer service and make it run -deployment.exposeViaService(serviceType: k8s.ServiceType.LOAD_BALANCER); diff --git a/k8s/examples/nodejs.main.w.snap b/k8s/examples/nodejs.main.w.snap deleted file mode 100644 index ff01459a..00000000 --- a/k8s/examples/nodejs.main.w.snap +++ /dev/null @@ -1,85 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: configmap-c870426f -data: - index.js: console.log("hello, k8s"); -immutable: false ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: deployment-c87ec702 -spec: - minReadySeconds: 0 - progressDeadlineSeconds: 600 - replicas: 3 - selector: - matchLabels: - cdk8s.io/metadata.addr: Deployment-c8c1f37c - strategy: - rollingUpdate: - maxSurge: 25% - maxUnavailable: 25% - type: RollingUpdate - template: - metadata: - labels: - cdk8s.io/metadata.addr: Deployment-c8c1f37c - spec: - automountServiceAccountToken: false - containers: - - command: - - node - - index.js - - "80" - image: node:14.4.0-alpine3.12 - imagePullPolicy: Always - name: main - ports: - - containerPort: 80 - resources: - limits: - cpu: 1500m - memory: 2048Mi - requests: - cpu: 1000m - memory: 512Mi - securityContext: - allowPrivilegeEscalation: false - privileged: false - readOnlyRootFilesystem: true - runAsNonRoot: true - startupProbe: - failureThreshold: 3 - tcpSocket: - port: 80 - volumeMounts: - - mountPath: /var/lib/app - name: configmap-configmap-c870426f - workingDir: /var/lib/app - dnsPolicy: ClusterFirst - hostNetwork: false - restartPolicy: Always - securityContext: - fsGroupChangePolicy: Always - runAsNonRoot: true - setHostnameAsFQDN: false - terminationGracePeriodSeconds: 30 - volumes: - - configMap: - name: configmap-c870426f - name: configmap-configmap-c870426f ---- -apiVersion: v1 -kind: Service -metadata: - name: deployment-service-c8f11c8e -spec: - externalIPs: [] - ports: - - port: 80 - targetPort: 80 - selector: - cdk8s.io/metadata.addr: Deployment-c8c1f37c - type: LoadBalancer diff --git a/k8s/examples/ubuntu.main.w b/k8s/examples/ubuntu.main.w deleted file mode 100644 index 901dbb9e..00000000 --- a/k8s/examples/ubuntu.main.w +++ /dev/null @@ -1,4 +0,0 @@ -bring "cdk8s-plus-27" as k8s; - -let deployment = new k8s.Deployment(replicas: 3); -deployment.addContainer(image: "ubuntu"); diff --git a/k8s/examples/ubuntu.main.w.snap b/k8s/examples/ubuntu.main.w.snap deleted file mode 100644 index 67fd9561..00000000 --- a/k8s/examples/ubuntu.main.w.snap +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: deployment-c87ec702 -spec: - minReadySeconds: 0 - progressDeadlineSeconds: 600 - replicas: 3 - selector: - matchLabels: - cdk8s.io/metadata.addr: Deployment-c8c1f37c - strategy: - rollingUpdate: - maxSurge: 25% - maxUnavailable: 25% - type: RollingUpdate - template: - metadata: - labels: - cdk8s.io/metadata.addr: Deployment-c8c1f37c - spec: - automountServiceAccountToken: false - containers: - - image: ubuntu - imagePullPolicy: Always - name: main - resources: - limits: - cpu: 1500m - memory: 2048Mi - requests: - cpu: 1000m - memory: 512Mi - securityContext: - allowPrivilegeEscalation: false - privileged: false - readOnlyRootFilesystem: true - runAsNonRoot: true - dnsPolicy: ClusterFirst - hostNetwork: false - restartPolicy: Always - securityContext: - fsGroupChangePolicy: Always - runAsNonRoot: true - setHostnameAsFQDN: false - terminationGracePeriodSeconds: 30 From 9f976e1bbd5d75b40fabf33fa27aaa02dbec3783 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 13:58:58 -0400 Subject: [PATCH 06/25] related to cdk8s import maybe? --- k8s/api-object.w | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/k8s/api-object.w b/k8s/api-object.w index 595e1ea2..c9f5de14 100644 --- a/k8s/api-object.w +++ b/k8s/api-object.w @@ -1,11 +1 @@ -bring "cdk8s" as cdk8s; - -pub struct ApiObjectProps extends cdk8s.ApiObjectProps { - spec: Json?; -} - -pub class ApiObject extends cdk8s.ApiObject { - new(props: ApiObjectProps) { - super(props); - } -} \ No newline at end of file +pub class ApiObject {} From b9f1929a939bd8dd49507b7731038080820f2791 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 14:01:18 -0400 Subject: [PATCH 07/25] is it related to lib/index.js? --- k8s/lib/index.js | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 k8s/lib/index.js diff --git a/k8s/lib/index.js b/k8s/lib/index.js deleted file mode 100644 index 2af865af..00000000 --- a/k8s/lib/index.js +++ /dev/null @@ -1,38 +0,0 @@ -const cdk8s = require('cdk8s'); -const { core, std } = require('@winglang/sdk');; - -exports.Platform = class { - target = "k8s"; - - newApp(props) { - const app = new cdk8s.App({ outdir: props.outdir }); - - const labels = process.env.WING_K8S_LABELS ? JSON.parse(process.env.WING_K8S_LABELS) : {}; - const namespace = process.env.WING_K8S_NAMESPACE; - const chart = new cdk8s.Chart(app, "Default", { labels, namespace }); - - class App extends core.App { - _target = "cdk8s"; - outdir = props.outdir; - - constructor() { - super(chart, "Default", props); - - const root = this.node.root; - root.new = (fqn, ctor, scope, id, ...args) => this.new(fqn, ctor, scope, id, ...args); - root.newAbstract = (fqn, scope, id, ...args) => this.newAbstract(fqn, scope, id, ...args); - root.typeForFqn = fqn => this.typeForFqn(fqn); - - std.Node._markRoot(props.rootConstruct); - new props.rootConstruct(this, props.rootId ?? "Default"); - } - - synth() { - app.synth(); - console.log(this.outdir); - } - } - - return new App(); - } -}; From 0095d5cae1e02ca690b64d04ddc66215c0759c9a Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 14:04:53 -0400 Subject: [PATCH 08/25] Revert "related to cdk8s import maybe?" This reverts commit 9f976e1bbd5d75b40fabf33fa27aaa02dbec3783. --- k8s/api-object.w | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/k8s/api-object.w b/k8s/api-object.w index c9f5de14..595e1ea2 100644 --- a/k8s/api-object.w +++ b/k8s/api-object.w @@ -1 +1,11 @@ -pub class ApiObject {} +bring "cdk8s" as cdk8s; + +pub struct ApiObjectProps extends cdk8s.ApiObjectProps { + spec: Json?; +} + +pub class ApiObject extends cdk8s.ApiObject { + new(props: ApiObjectProps) { + super(props); + } +} \ No newline at end of file From 9e9a8eba81a043c974fb6d964c2f44614de6cbf7 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 14:05:19 -0400 Subject: [PATCH 09/25] Revert "Revert "related to cdk8s import maybe?"" This reverts commit 0095d5cae1e02ca690b64d04ddc66215c0759c9a. --- k8s/api-object.w | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/k8s/api-object.w b/k8s/api-object.w index 595e1ea2..c9f5de14 100644 --- a/k8s/api-object.w +++ b/k8s/api-object.w @@ -1,11 +1 @@ -bring "cdk8s" as cdk8s; - -pub struct ApiObjectProps extends cdk8s.ApiObjectProps { - spec: Json?; -} - -pub class ApiObject extends cdk8s.ApiObject { - new(props: ApiObjectProps) { - super(props); - } -} \ No newline at end of file +pub class ApiObject {} From 9dad046b4f46bc19a0ac1a738e8f795c9a44b824 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 14:05:52 -0400 Subject: [PATCH 10/25] add back lib/index.js --- k8s/lib/index.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 k8s/lib/index.js diff --git a/k8s/lib/index.js b/k8s/lib/index.js new file mode 100644 index 00000000..d7169264 --- /dev/null +++ b/k8s/lib/index.js @@ -0,0 +1,38 @@ +const cdk8s = require('cdk8s'); +const { core, std } = require('@winglang/sdk');; + +exports.Platform = class { + target = "k8s"; + + newApp(props) { + const app = new cdk8s.App({ outdir: props.outdir }); + + const labels = process.env.WING_K8S_LABELS ? JSON.parse(process.env.WING_K8S_LABELS) : {}; + const namespace = process.env.WING_K8S_NAMESPACE; + const chart = new cdk8s.Chart(app, "Default", { labels, namespace }); + + class App extends core.App { + _target = "cdk8s"; + outdir = props.outdir; + + constructor() { + super(chart, "Default", props); + + const root = this.node.root; + root.new = (fqn, ctor, scope, id, ...args) => this.new(fqn, ctor, scope, id, ...args); + root.newAbstract = (fqn, scope, id, ...args) => this.newAbstract(fqn, scope, id, ...args); + root.typeForFqn = fqn => this.typeForFqn(fqn); + + std.Node._markRoot(props.rootConstruct); + new props.rootConstruct(this, props.rootId ?? "Default"); + } + + synth() { + app.synth(); + console.log(this.outdir); + } + } + + return new App(); + } +}; From 4fcf529f3043bee36de071dea58eaa617cc3b390 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 14:08:48 -0400 Subject: [PATCH 11/25] try commenting stuff out --- k8s/lib/index.js | 54 ++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/k8s/lib/index.js b/k8s/lib/index.js index d7169264..b0b5a38e 100644 --- a/k8s/lib/index.js +++ b/k8s/lib/index.js @@ -1,38 +1,38 @@ const cdk8s = require('cdk8s'); const { core, std } = require('@winglang/sdk');; -exports.Platform = class { - target = "k8s"; +// exports.Platform = class { +// target = "k8s"; - newApp(props) { - const app = new cdk8s.App({ outdir: props.outdir }); +// newApp(props) { +// const app = new cdk8s.App({ outdir: props.outdir }); - const labels = process.env.WING_K8S_LABELS ? JSON.parse(process.env.WING_K8S_LABELS) : {}; - const namespace = process.env.WING_K8S_NAMESPACE; - const chart = new cdk8s.Chart(app, "Default", { labels, namespace }); +// const labels = process.env.WING_K8S_LABELS ? JSON.parse(process.env.WING_K8S_LABELS) : {}; +// const namespace = process.env.WING_K8S_NAMESPACE; +// const chart = new cdk8s.Chart(app, "Default", { labels, namespace }); - class App extends core.App { - _target = "cdk8s"; - outdir = props.outdir; +// class App extends core.App { +// _target = "cdk8s"; +// outdir = props.outdir; - constructor() { - super(chart, "Default", props); +// constructor() { +// super(chart, "Default", props); - const root = this.node.root; - root.new = (fqn, ctor, scope, id, ...args) => this.new(fqn, ctor, scope, id, ...args); - root.newAbstract = (fqn, scope, id, ...args) => this.newAbstract(fqn, scope, id, ...args); - root.typeForFqn = fqn => this.typeForFqn(fqn); +// const root = this.node.root; +// root.new = (fqn, ctor, scope, id, ...args) => this.new(fqn, ctor, scope, id, ...args); +// root.newAbstract = (fqn, scope, id, ...args) => this.newAbstract(fqn, scope, id, ...args); +// root.typeForFqn = fqn => this.typeForFqn(fqn); - std.Node._markRoot(props.rootConstruct); - new props.rootConstruct(this, props.rootId ?? "Default"); - } +// std.Node._markRoot(props.rootConstruct); +// new props.rootConstruct(this, props.rootId ?? "Default"); +// } - synth() { - app.synth(); - console.log(this.outdir); - } - } +// synth() { +// app.synth(); +// console.log(this.outdir); +// } +// } - return new App(); - } -}; +// return new App(); +// } +// }; From 71bdc7dcad464d4d92d96176c5484e8fe373dd1b Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 14:12:53 -0400 Subject: [PATCH 12/25] testing --- k8s/lib/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/k8s/lib/index.js b/k8s/lib/index.js index b0b5a38e..611c0d1f 100644 --- a/k8s/lib/index.js +++ b/k8s/lib/index.js @@ -1,5 +1,7 @@ -const cdk8s = require('cdk8s'); -const { core, std } = require('@winglang/sdk');; +console.log("loading @winglibs/k8s"); + +// const cdk8s = require('cdk8s'); +// const { core, std } = require('@winglang/sdk');; // exports.Platform = class { // target = "k8s"; From 132d794bc3581ef2d4f6b75bdd9766d7cd65c4f0 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 14:15:33 -0400 Subject: [PATCH 13/25] does renaming the file make a difference --- k8s/lib/{index.js => blah.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename k8s/lib/{index.js => blah.js} (100%) diff --git a/k8s/lib/index.js b/k8s/lib/blah.js similarity index 100% rename from k8s/lib/index.js rename to k8s/lib/blah.js From e54ab9bd1de5a7a9be3ef08fb8d8b7dcd9b72f09 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 14:16:59 -0400 Subject: [PATCH 14/25] what if I move the file to the root? --- k8s/{lib => }/blah.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename k8s/{lib => }/blah.js (100%) diff --git a/k8s/lib/blah.js b/k8s/blah.js similarity index 100% rename from k8s/lib/blah.js rename to k8s/blah.js From e208740cf3b0b91e09509d4b2acc11ff10820467 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 14:18:30 -0400 Subject: [PATCH 15/25] what if I move it to another folder? --- k8s/{ => other}/blah.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename k8s/{ => other}/blah.js (100%) diff --git a/k8s/blah.js b/k8s/other/blah.js similarity index 100% rename from k8s/blah.js rename to k8s/other/blah.js From 27b6005701b421ba5b05b8d44ef55a96946ba183 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 14:22:08 -0400 Subject: [PATCH 16/25] move it back to lib to confirm the hanging --- k8s/{other => lib}/blah.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename k8s/{other => lib}/blah.js (100%) diff --git a/k8s/other/blah.js b/k8s/lib/blah.js similarity index 100% rename from k8s/other/blah.js rename to k8s/lib/blah.js From 50cb33ad04ea7bd7f74d9c7e469c04b2aceeb211 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 14:23:38 -0400 Subject: [PATCH 17/25] what if it's just a text file? --- k8s/lib/blah.js | 40 ---------------------------------------- k8s/lib/blah.txt | 1 + 2 files changed, 1 insertion(+), 40 deletions(-) delete mode 100644 k8s/lib/blah.js create mode 100644 k8s/lib/blah.txt diff --git a/k8s/lib/blah.js b/k8s/lib/blah.js deleted file mode 100644 index 611c0d1f..00000000 --- a/k8s/lib/blah.js +++ /dev/null @@ -1,40 +0,0 @@ -console.log("loading @winglibs/k8s"); - -// const cdk8s = require('cdk8s'); -// const { core, std } = require('@winglang/sdk');; - -// exports.Platform = class { -// target = "k8s"; - -// newApp(props) { -// const app = new cdk8s.App({ outdir: props.outdir }); - -// const labels = process.env.WING_K8S_LABELS ? JSON.parse(process.env.WING_K8S_LABELS) : {}; -// const namespace = process.env.WING_K8S_NAMESPACE; -// const chart = new cdk8s.Chart(app, "Default", { labels, namespace }); - -// class App extends core.App { -// _target = "cdk8s"; -// outdir = props.outdir; - -// constructor() { -// super(chart, "Default", props); - -// const root = this.node.root; -// root.new = (fqn, ctor, scope, id, ...args) => this.new(fqn, ctor, scope, id, ...args); -// root.newAbstract = (fqn, scope, id, ...args) => this.newAbstract(fqn, scope, id, ...args); -// root.typeForFqn = fqn => this.typeForFqn(fqn); - -// std.Node._markRoot(props.rootConstruct); -// new props.rootConstruct(this, props.rootId ?? "Default"); -// } - -// synth() { -// app.synth(); -// console.log(this.outdir); -// } -// } - -// return new App(); -// } -// }; diff --git a/k8s/lib/blah.txt b/k8s/lib/blah.txt new file mode 100644 index 00000000..092bfb9b --- /dev/null +++ b/k8s/lib/blah.txt @@ -0,0 +1 @@ +yo From a6fd98ba87ebcd4a2a670aaaeb82edf74ec17868 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 14:36:09 -0400 Subject: [PATCH 18/25] try changing test.sh script --- k8s/test.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/k8s/test.sh b/k8s/test.sh index fed6ee9b..b41e6f88 100755 --- a/k8s/test.sh +++ b/k8s/test.sh @@ -1,2 +1,5 @@ #!/bin/sh -echo Done +echo "Compiling..." +wing compile . +echo "Generating docs..." +wing gen-docs From 3367d4a675e28408b8a3c11407c70a631d25e983 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 14:38:14 -0400 Subject: [PATCH 19/25] try a debug flag? --- k8s/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/test.sh b/k8s/test.sh index b41e6f88..eb9bec61 100755 --- a/k8s/test.sh +++ b/k8s/test.sh @@ -2,4 +2,4 @@ echo "Compiling..." wing compile . echo "Generating docs..." -wing gen-docs +DEBUG="*" wing gen-docs From 800ddf8066a9856d3a7af4128c4fe303d6eece32 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 14:44:33 -0400 Subject: [PATCH 20/25] try to force timeout --- k8s/test.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/k8s/test.sh b/k8s/test.sh index eb9bec61..37b07804 100755 --- a/k8s/test.sh +++ b/k8s/test.sh @@ -2,4 +2,9 @@ echo "Compiling..." wing compile . echo "Generating docs..." -DEBUG="*" wing gen-docs +timeout 5s DEBUG="*" wing gen-docs + +if [ $? -eq 124 ]; then + echo "Command timed out after 5 seconds" + exit 1 +fi From 661c0465bcb1600654c8e57a66685fedcca23e20 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 14:45:32 -0400 Subject: [PATCH 21/25] try quotes --- k8s/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/test.sh b/k8s/test.sh index 37b07804..748ea621 100755 --- a/k8s/test.sh +++ b/k8s/test.sh @@ -2,7 +2,7 @@ echo "Compiling..." wing compile . echo "Generating docs..." -timeout 5s DEBUG="*" wing gen-docs +timeout 5s 'DEBUG="*" wing gen-docs' if [ $? -eq 124 ]; then echo "Command timed out after 5 seconds" From da5d49417eb82704702f3b59381b52e95818dd40 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 14:50:35 -0400 Subject: [PATCH 22/25] add logic to kill wing gen-docs after 2 seconds --- k8s/test.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/k8s/test.sh b/k8s/test.sh index 748ea621..d716d90a 100755 --- a/k8s/test.sh +++ b/k8s/test.sh @@ -2,9 +2,13 @@ echo "Compiling..." wing compile . echo "Generating docs..." -timeout 5s 'DEBUG="*" wing gen-docs' -if [ $? -eq 124 ]; then - echo "Command timed out after 5 seconds" - exit 1 +( DEBUG="*" wing gen-docs ) & pid=$! +( sleep 2 && kill -HUP $pid ) 2>/dev/null & watcher=$! +if wait $pid 2>/dev/null; then + echo "your_command finished" + pkill -HUP -P $watcher + wait $watcher +else + echo "your_command interrupted" fi From 0d56ea1b1a9d6f38a8f7b98048da69b0216de96c Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 14:52:56 -0400 Subject: [PATCH 23/25] try twice, once with file and once without --- k8s/test.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/k8s/test.sh b/k8s/test.sh index d716d90a..524d1947 100755 --- a/k8s/test.sh +++ b/k8s/test.sh @@ -12,3 +12,18 @@ if wait $pid 2>/dev/null; then else echo "your_command interrupted" fi + +echo "Done" +echo "Removing lib/blah.txt" + +rm lib/blah.txt + +( DEBUG="*" wing gen-docs ) & pid=$! +( sleep 2 && kill -HUP $pid ) 2>/dev/null & watcher=$! +if wait $pid 2>/dev/null; then + echo "your_command finished" + pkill -HUP -P $watcher + wait $watcher +else + echo "your_command interrupted" +fi From 133d7ce2ed562b03af8c76a14226cd7ac70bf2cf Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 14:56:06 -0400 Subject: [PATCH 24/25] try something slightly different --- k8s/test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/test.sh b/k8s/test.sh index 524d1947..0a4c72c2 100755 --- a/k8s/test.sh +++ b/k8s/test.sh @@ -14,9 +14,9 @@ else fi echo "Done" -echo "Removing lib/blah.txt" +echo "Removing lib/" -rm lib/blah.txt +rm -rf lib ( DEBUG="*" wing gen-docs ) & pid=$! ( sleep 2 && kill -HUP $pid ) 2>/dev/null & watcher=$! From 89ed2ed607fc453c4c8ce86d51706fee9455e30f Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 30 Aug 2024 18:02:35 -0400 Subject: [PATCH 25/25] remove some testing code --- k8s/test.sh | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/k8s/test.sh b/k8s/test.sh index 0a4c72c2..adfd14ec 100755 --- a/k8s/test.sh +++ b/k8s/test.sh @@ -1,29 +1,2 @@ #!/bin/sh -echo "Compiling..." -wing compile . -echo "Generating docs..." - -( DEBUG="*" wing gen-docs ) & pid=$! -( sleep 2 && kill -HUP $pid ) 2>/dev/null & watcher=$! -if wait $pid 2>/dev/null; then - echo "your_command finished" - pkill -HUP -P $watcher - wait $watcher -else - echo "your_command interrupted" -fi - echo "Done" -echo "Removing lib/" - -rm -rf lib - -( DEBUG="*" wing gen-docs ) & pid=$! -( sleep 2 && kill -HUP $pid ) 2>/dev/null & watcher=$! -if wait $pid 2>/dev/null; then - echo "your_command finished" - pkill -HUP -P $watcher - wait $watcher -else - echo "your_command interrupted" -fi