Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worktimes Support #9

Merged
merged 5 commits into from
Mar 25, 2024
Merged

Worktimes Support #9

merged 5 commits into from
Mar 25, 2024

Conversation

wiwichips
Copy link
Collaborator

@wiwichips wiwichips commented Mar 20, 2024

Worktimes Support in DCP-Rest

This PR replaces the work.language feature with proper DCP Worktimes.

Historical Context

work.language was created in summer 2023, way before Worktimes were implemented properly into DCP. It worked similarly, but relied on the dcp-package manager or the workfunction being decorated before getting deployed to DCP. You could select three different languages: "JavasScript", "TypeScript", and "Python".

API

Worktimes can be passed as part of requests to dcp-rest like this:

"work": {
    "runtime": {
        "name": "pyodide",
        "version": ">=0.0.0",
        "custom": false
    }
}

Example

Here is an example request which deploys a Python program to dcp and specifies it to be executed in the pyodide Worktime.

{
	"work": {
		"runtime": {
                	"name": "pyodide"
                },
		"function": "def my_func(datum):\n    dcp.progress()\n    return datum * 7\ndcp.set_slice_handler(my_func)"
	},
	"account": {
		"json": ...,
		"password": ""
	}
}

Other stuff this MR does...

  • updates npm packages
  • allows for jobs to be deployed via basic auth
  • allows bank account keystores to be uploaded as json

Previously, it used your oauth identity to grab keystores.
This enables the ability to deploy jobs by uploading a keystore
with them for the payment address;
@wiwichips wiwichips marked this pull request as draft March 20, 2024 20:59
@wiwichips
Copy link
Collaborator Author

Drafted this MR since Maria found problems with whatever verison of dcp-client comes with the package.json...

I'll investigate tomorrow...

@wiwichips wiwichips marked this pull request as ready for review March 21, 2024 12:25
@wiwichips
Copy link
Collaborator Author

Ready for review again, I had an outdated version of dcp-client in the package.json.

dcp-client
kvin

dotenv
dotenv-expand

cors
express
express-openapi-validator
express-validator

sqlite3 <-- note, sqlite3 will be deprecated soon
@wiwichips wiwichips force-pushed the feature/worktimes-job-deploy branch from 13f6fb8 to 16e9091 Compare March 21, 2024 12:29
@wiwichips wiwichips merged commit 98c3348 into main Mar 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants