GAM icon indicating copy to clipboard operation
GAM copied to clipboard

Classroom sync won't work in bulk mode

Open aglim opened this issue 6 years ago • 8 comments

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).

aglim avatar Sep 04 '20 15:09 aglim

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]

taers232c avatar Sep 04 '20 15:09 taers232c

Workaround: use batch file method gam batch commands.txt

  1. Generate commands using excel. The syntax for me:
  2. ="gam course "&J2&" sync students group "&K2&CHAR(10)&"commit-batch"
  3. 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)

vmatt avatar Sep 07 '20 23:09 vmatt

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

taers232c avatar Sep 08 '20 01:09 taers232c

Well, batch worked for me. With commit-batch ofc.

vmatt avatar Sep 09 '20 15:09 vmatt

What is your Gam version?

taers232c avatar Sep 09 '20 15:09 taers232c

GAM 5.11

gam course courseID sync students group groupName
commit-batch
gam course courseID sync students group groupName
commit-batch
...

vmatt avatar Sep 09 '20 15:09 vmatt

Can you contact me via Google Hangouts/Meet or Zoom?

[email protected]

taers232c avatar Sep 09 '20 15:09 taers232c

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Dec 08 '20 16:12 stale[bot]