Classroom sync won't work in bulk mode
I'm facing the problem that syncing classroom students doesn't work properly in bulk mode (csv file with 2 rows):
> gam csv export.csv gam course ~alias sync students group ~student_group
Using 2 processes...
Got 22 Students...
Getting all members of 2023a@***.ru (may take some time for large groups)...
Got 25 Students...
Getting all members of 2020a@***.ru (may take some time for large groups)...
Got 22 all members...
Got 25 all members...
Group members are fetched but no addition/removal happens after that. Although it works when single sync is run (group members fetched then list updated in parallel).
Is the problem in parallel-fashion update step in sync? When running in bulk mode it starts to run parallel syncs then each sync turns to run its parallel update (parallelization squared).
This is not supported in Standard GAM.
Ross
On Fri, Sep 4, 2020 at 8:33 AM aglim [email protected] wrote:
I'm facing the problem that syncing classroom students doesn't work properly in bulk mode (csv file with 2 rows):
gam csv export.csv gam course ~alias sync students group ~student_group Using 2 processes... Got 22 Students...
Getting all members of 2023a@***.ru (may take some time for large groups)... Got 25 Students...
Getting all members of 2020a@***.ru (may take some time for large groups)... Got 22 all members...
Got 25 all members...
Group members are fetched but no addition/removal happens after that. Although it works when single sync is run (group members fetched then list updated in parallel).
Is the problem in parallel-fashion update step in sync? When running in bulk mode it starts to run parallel syncs then each sync turns to run its parallel update (parallelization squared).
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jay0lee/GAM/issues/1231, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYL2AEH2EGCBYQ37WENLSEECDTANCNFSM4QYVFURQ .
-- Ross Scroggs [email protected]
Workaround: use batch file method
gam batch commands.txt
- Generate commands using excel. The syntax for me:
="gam course "&J2&" sync students group "&K2&CHAR(10)&"commit-batch"- Copy that column into a new text file such as commands.txt
"Commit-batch" should definitely there to be separate the classes. also, you can increase your speed in Windows CLI with "set gam_threads=10" (Do not set over 15-20, the API will throw errors, that you have to find and correct manually)
This does not work in any reasonably current version of GAM for the same reason that
gam csv filename.csv gam course ~id sync students group ~student_group
doesn't work.
Gam uses Python processes (as opposed to Python threads in old versions) to execute gam batch and gam csv and also uses Python processes to execute gam course sync students.
But a Python process can not have a sub process, thus the sync doesn't do anything.
$ gam version
GAM 5.11 - https://git.io/gam - pythonsource
---
$ gam print courses teacher testuser1 show students fields id,name,ownerid owneremail
Getting all Courses in G Suite account (may take some time on a large account)...
Got 1 Courses...
Got 0 Students for course 47491913641 (1/1)
id,name,ownerEmail,ownerId,students
47491913641,Test,[email protected],118080758787650801331,0
$ more coursesync.bat
gam course 47491913641 sync students group [email protected]
commit-batch
$ gam batch coursesync.bat
Using 1 processes...
Got 0 Students...
Getting all members of [email protected] (may take some time for large groups)...
Got 2 all members...
$ gam print courses teacher testuser1 show students fields id,name,ownerid owneremail
Getting all Courses in G Suite account (may take some time on a large account)...
Got 1 Courses...
Got 0 Students for course 47491913641 (1/1)
id,name,ownerEmail,ownerId,students
47491913641,Test,[email protected],118080758787650801331,0
Ross
Well, batch worked for me. With commit-batch ofc.
What is your Gam version?
GAM 5.11
gam course courseID sync students group groupName
commit-batch
gam course courseID sync students group groupName
commit-batch
...
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.