dcp-client 4.3.2-webgpu.1 → 4.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -225,6 +225,8 @@ very familiar the inner workings of the JavaScript event loop.
225
225
  ## Debugging
226
226
  The DCP Compute API includes a function called `localExec` which can be used in place of the `exec` method on the JobHandle. When this function is invoked, a DCP client will create a worker which receives your job from the scheduler, and this job will be limited to that worker. In the browser, this is implemented inside a Web Worker; in NodeJS this is implemented with a standalone worker running within the client process. In either case, it should be possible to use the `debugger` keyword in your work function to trigger a breakpoint in your favourite debugger.
227
227
 
228
+ *Note:* using localExec on Node.js requires that you install `dcp-client`'s peer dependency, `dcp-worker`.
229
+
228
230
  ### niim
229
231
  The [`niim`](https://www.npmjs.com/package/niim) debugger is a command-line debugger for Node.js which is a fork of node-inspect. If you are debugging a dcp-client with niim and it asks you for a passphrase, use the send function:
230
232
  ```send "passpharse\n"```
@@ -0,0 +1,74 @@
1
+ #! /usr/bin/env bash
2
+ #
3
+ # @file publish-docs.sh
4
+ # @athor Brandon Christie <brandon@distributive.network>
5
+ # @date Aug 2023
6
+ #
7
+ # @description Publishes the docs for each component
8
+ # to backstage.
9
+
10
+ set -euo pipefail
11
+
12
+ cd "$(dirname "$0")/.."
13
+
14
+ ROOT_DIR=$PWD
15
+
16
+ echo "TechDocs Bucket Name: $TECHDOCS_S3_BUCKET_NAME"
17
+ echo "Namespace: $ENTITY_NAMESPACE"
18
+
19
+ ENTITY_KIND=$(yq ".kind" < catalog-info.yaml)
20
+ echo "Kind: $ENTITY_KIND"
21
+
22
+ ENTITY_NAME=$(yq ".metadata.name" < catalog-info.yaml)
23
+ echo "Name: $ENTITY_NAME"
24
+
25
+ TECHDOCS_REF=$(yq ".metadata.annotations.\"backstage.io/techdocs-ref\"" < catalog-info.yaml)
26
+ echo "TechDocs Ref: $TECHDOCS_REF"
27
+
28
+ # An example of the the techdocs-ref in the YAML file:
29
+ # dir:./docs/dcp
30
+ #
31
+ # The Regex below will isolate the directory path giving the
32
+ # result 'docs/dcp' for the given example.
33
+ if [[ "$TECHDOCS_REF" =~ dir:\.(.*) ]]; then
34
+ RELATIVE_DOCS_DIR="${BASH_REMATCH[1]%%[[:space:]]*}"
35
+ DOCS_DIR="$ROOT_DIR/$RELATIVE_DOCS_DIR"
36
+ fi
37
+
38
+ # The techdocs-cli commands must be called in the directory where the
39
+ # mkdocs.yml file is present.
40
+ cd "$DOCS_DIR"
41
+
42
+ # MkDocs requires an index.md or README.md file, if one does not exist it will
43
+ # be generated automatically.
44
+ if ! [ -f index.md ] && ! [ -f README.md ]; then
45
+ if [ -z "$CI" ]; then
46
+ AUTHOR="$(git config user.name) <$(git config user.email)>"
47
+ else
48
+ AUTHOR="$CI_COMMIT_AUTHOR"
49
+ fi
50
+
51
+ echo "README.md or index.md was not found and will be automatically generated."
52
+ cat >> index.md <<EOF
53
+ <!--
54
+ @author $AUTHOR
55
+ @date $(date)
56
+ @machine $HOSTNAME
57
+ @rev $(git rev-parse HEAD)
58
+ -->
59
+ > **Warning**: MkDocs requires a top level index.md or README.md (case sensitive)
60
+ This index.md file has been generated automatically to ensure MkDocs works correctly
61
+ EOF
62
+ fi
63
+
64
+ npx techdocs-cli generate --no-docker --verbose
65
+
66
+ npx techdocs-cli publish \
67
+ --publisher-type awsS3 \
68
+ --storage-name "$TECHDOCS_S3_BUCKET_NAME" \
69
+ --entity "$ENTITY_NAMESPACE"/"$ENTITY_KIND"/"$ENTITY_NAME" \
70
+ --directory "$ROOT_DIR"/site
71
+
72
+ rm -r "$ROOT_DIR"/site
73
+
74
+ echo "View generated component: https://backstage.overwatch.distributive.network/docs/default/component/$ENTITY_NAME"
@@ -0,0 +1,21 @@
1
+ # @file catalog-info.yml
2
+ # @author Brandon Christie <brandon@distributive.network>
3
+ # @date Mar 2023
4
+ #
5
+ # @description Lists all of the components and the paths to all
6
+ # the documentation that will be published to backstage.
7
+
8
+ apiVersion: backstage.io/v1alpha1
9
+ kind: Component
10
+ metadata:
11
+ name: dcp-client
12
+ description: Documentation for the dcp-client.
13
+ tags:
14
+ - documentation
15
+ annotations:
16
+ gitlab.com/project-id: '9874684'
17
+ backstage.io/techdocs-ref: dir:./docs
18
+ spec:
19
+ type: library
20
+ lifecycle: production
21
+ owner: core