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

[Job Launcher] Launch hСaptcha jobs #1220

Merged
merged 54 commits into from
Dec 19, 2023
Merged

Conversation

eugenvoronov
Copy link
Contributor

@eugenvoronov eugenvoronov commented Nov 8, 2023

Description

Implement a new job type called hCaptcha within Job Launcher to allow the launching of jobs with specific types, such as ImageLabelBinary, ImageLabelMultipleChoice, ImageLabelAreaSelect, and TextFreeEntry. The goal is to create an infrastructure that will allow new jobs of this type to be created in the job service. The infrastructure includes creating new classes that use the class-validator as part of manifest validation process, adding a manifest encryption before sending it to the public bucket, adding data file generation for using hCaptcha.

Summary of changes

  • Implemented POST /job/hCaptcha controller
  • Implemented hCaptcha job type to createJob method in Job Service
  • Implemented createHCaptchaManifest method in Job Service
  • Implemented basic unit tests

How test the changes

POST /job/hCaptcha with body

{
  "chainId": 80001,
  "dataUrl": "https://32d6-185-231-205-182.ngrok.io/launcher",
  "accuracyTarget": 0.9,
  "completionDate": "2023-11-07T06:19:30.933Z",
  "minRequests": 1,
  "maxRequests": 5,
  "advanced": {
    "workerLanguage": "en",
    "workerLocation": "FR",
    "targetBrowser": "desktop"
  },
  "annotations": {
    "typeOfJob": "comparison",
    "taskBidPrice": 0.1,
    "labelingPrompt": "Hello",
    "groundTruths": "http://127.0.0.1:9000/data/comparison_gt.json",
    "exampleImages": [
      "http://127.0.0.1:9000/jpgs/1.jpg"
    ]
  }
}

POST /job/cron/launch
yarn test

Use the deployed version of the job launcher server to launch hCaptcha jobs.

Related issues

Job Launcher - Launch hСaptcha jobs#993

@eugenvoronov eugenvoronov requested a review from portuu3 November 8, 2023 09:30
@eugenvoronov eugenvoronov self-assigned this Nov 8, 2023
Copy link

vercel bot commented Nov 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
job-launcher-server ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 19, 2023 4:29pm
reputation-oracle-server ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 19, 2023 4:29pm
13 Ignored Deployments
Name Status Preview Comments Updated (UTC)
escrow-dashboard ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2023 4:29pm
faucet-server ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2023 4:29pm
fortune-exchange-oracle ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2023 4:29pm
fortune-exchange-oracle-server ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2023 4:29pm
fortune-job-launcher-client ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2023 4:29pm
fortune-job-launcher-server ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2023 4:29pm
fortune-recording-oracle ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2023 4:29pm
fortune-reputation-oracle ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2023 4:29pm
hufi-exchange-oracle-server ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2023 4:29pm
hufi-job-launcher-server ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2023 4:29pm
hufi-recording-oracle-server ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2023 4:29pm
hufi-reputation-oracle ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2023 4:29pm
job-launcher-client ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2023 4:29pm

@eugenvoronov eugenvoronov linked an issue Nov 8, 2023 that may be closed by this pull request
11 tasks
@eugenvoronov eugenvoronov requested a review from Dzeranov November 8, 2023 09:30
public async listObjectsInBucket(bucketUrl: string): Promise<string[]> {
return new Promise(async (resolve, reject) => {
try {
const response = await axios.get(bucketUrl);

Check failure

Code scanning / CodeQL

Server-side request forgery

The [URL](1) of this request depends on a [user-provided value](2). The [URL](1) of this request depends on a [user-provided value](3). The [URL](1) of this request depends on a [user-provided value](4).
portuu3
portuu3 previously approved these changes Dec 19, 2023
portuu3
portuu3 previously approved these changes Dec 19, 2023
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.

Job Launcher - Launch hСaptcha jobs
2 participants