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

Add Prolific provider (#1008) #1012

Merged
merged 53 commits into from
Aug 4, 2023
Merged

Add Prolific provider (#1008) #1012

merged 53 commits into from
Aug 4, 2023

Conversation

meta-paul
Copy link
Contributor

No description provided.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 13, 2023
Copy link
Contributor

@JackUrb JackUrb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall structure looks good. Big fan of having the prolific_api wrapped into a useful utility. I'm not sure it should sit in base mephisto given it should only be used in mephisto core through the abstractions layer.

Added some early thoughts about Qualifications in Prolific's API, since these will likely be the hardest to map.

mephisto/abstractions/providers/prolific/prolific_utils.py Outdated Show resolved Hide resolved
mephisto/abstractions/providers/prolific/prolific_utils.py Outdated Show resolved Hide resolved
@@ -84,6 +84,8 @@ tornado = { version = "^6.0", optional = false }
parlai = { version = "^1.7.0", optional = true }
torch = { version = "^1.4.0", optional = true }

# jsonschema
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment is generally the purpose for having the library. Here it's likely "api validation"?

@codecov-commenter
Copy link

codecov-commenter commented Mar 16, 2023

Codecov Report

Patch coverage: 45.73% and project coverage change: -3.55% ⚠️

Comparison is base (d81d54f) 63.99% compared to head (c66b861) 60.45%.
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1012      +/-   ##
==========================================
- Coverage   63.99%   60.45%   -3.55%     
==========================================
  Files         108      155      +47     
  Lines        9472    11796    +2324     
==========================================
+ Hits         6062     7131    +1069     
- Misses       3410     4665    +1255     
Files Changed Coverage Δ
mephisto/abstractions/databases/local_database.py 89.80% <ø> (ø)
...phisto/abstractions/providers/mturk/mturk_agent.py 35.38% <0.00%> (ø)
...ephisto/abstractions/providers/mturk/mturk_unit.py 15.70% <ø> (ø)
mephisto/operations/operator.py 69.59% <0.00%> (+0.23%) ⬆️
...histo/abstractions/architects/ec2/ec2_architect.py 34.59% <10.00%> (-1.41%) ⬇️
.../abstractions/providers/prolific/prolific_utils.py 19.17% <19.17%> (ø)
...o/abstractions/providers/prolific/prolific_unit.py 19.56% <19.56%> (ø)
...abstractions/providers/prolific/prolific_worker.py 24.82% <24.82%> (ø)
.../abstractions/providers/prolific/prolific_agent.py 27.92% <27.92%> (ø)
mephisto/utils/qualifications.py 26.15% <28.57%> (+0.34%) ⬆️
... and 47 more

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@meta-paul meta-paul force-pushed the add-prolific-provider branch from 5c2677b to c52921c Compare March 16, 2023 19:56
@meta-paul meta-paul force-pushed the add-prolific-provider branch from c52921c to 87b37a3 Compare March 27, 2023 17:48
@meta-paul meta-paul force-pushed the add-prolific-provider branch 7 times, most recently from f90ac1a to 08aa5c3 Compare April 11, 2023 15:47
@meta-paul meta-paul force-pushed the add-prolific-provider branch from 08aa5c3 to 7aa9fda Compare April 11, 2023 15:51
Copy link
Contributor

@JackUrb JackUrb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall solid progress here, the provider is really beginning to take shape! Some comments

docker/aws_credentials.example Outdated Show resolved Hide resolved
examples/simple_static_task/static_test_script.py Outdated Show resolved Hide resolved
mephisto/abstractions/providers/prolific/api/bonuses.py Outdated Show resolved Hide resolved
available_balance: Optional[Union[int, float]]
balance: Optional[Union[int, float]]
balance_breakdown: Optional[dict]
beta_tester: bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't imagine that all of these fields will end up being populated in a consistent manner, let alone relevant.

mephisto/abstractions/providers/prolific/prolific_agent.py Outdated Show resolved Hide resolved
mephisto/abstractions/providers/prolific/prolific_agent.py Outdated Show resolved Hide resolved
Copy link
Contributor

@JackUrb JackUrb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took another pass, a few more nits and a comment on the last visible remaining step for Qualifications that I see.

mephisto/abstractions/architects/ec2/ec2_architect.py Outdated Show resolved Hide resolved
params = workspace.to_dict()
if params["description"] == "":
params.pop("description", None)
params.pop("product", None) # TODO: What is this? Don't see this field in API docs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering this too - I've started getting it from Workspace, but if I drop this then the API call yells at me for including an incorrect value for product.

@meta-paul meta-paul force-pushed the add-prolific-provider branch from a4e5e25 to 3d13138 Compare July 12, 2023 02:04
@@ -0,0 +1,42 @@
#!/usr/bin/env python3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that this is all functional, I'm not sure what the correct thing for us to be doing to demonstrate different providers will be, but I don't think it's going to be to have a different script in here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that there are some Prolific-specific bits in there, like default_config_file and shared_state.prolific_specific_qualifications (it was meant to show how to work with Prolific-specific integration)

Copy link
Contributor

@JackUrb JackUrb Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, just I think we need to have another way to demonstrate provider use in a script, rather than leaving them in task examples (something like examples/providers which uses a simple task (ideally the React variant) and show it for multiple providers). We can commit here for now, but it's a TODO item.

mephisto/abstractions/database.py Outdated Show resolved Hide resolved
Comment on lines +41 to +42
# Name wrapper after wrapped class (for logging)
Wrapper.__name__ = target_cls.__name__
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition


return self.db_status

# Remaining statuses are tracking a live Study
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To match our intended semantics it should be tracking a live submission.

client = self._get_client(requester.requester_name)

# time.sleep(2) # Prolific servers may take time to bring their data up-to-date
study = prolific_utils.get_study(client, prolific_study_id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And you should write get_submission, as the statuses of a submission should align here:
Screenshot 2023-07-27 at 11 49 50 AM

@meta-paul meta-paul marked this pull request as ready for review August 4, 2023 17:40
@JackUrb JackUrb merged commit 238f832 into main Aug 4, 2023
@JackUrb JackUrb deleted the add-prolific-provider branch August 4, 2023 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants