Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Code Integration: Operations and Scenarios

R Convenience Functions

codeObj <- Code(name, parent,

...

localRoot)

parameters

name

parent: a Project ID

codeRepo:  the (brief and easily remembered) name of the code repositorylocalRoot: local 'root' directory for code files.  If omitted , a default is used.

side effects
none

returns

new Code object

addFile(codeObj, localPath

...

)

parameters

codeObj

localPath: path to file or directory on machine running the R sessionrepoPath: path relative to repository.  If omitted then a default path is generated.

side effects

 none

returns

 nothing

storeEntity(codeObj)

parameters

 codeObj

side effects

Checks that code is committed to svn, stops if not, printing out the needed svn command(s). [Alt.:  Could do svn 'add',  'commit' on the user's behalf.]zips files and pushes them to S3.  The file path stored is relative to the 'localRoot' in the code object.

Creates or updates metadata in Synapse, including code versionS3 location.

returns

 nothing

downloadEntity(codeId,

...

localRoot)

parameters

codeId: id of metadata object in SynapselocalPath

:  directory on machine which is running the R sessionlocalRoot: local 'root' directory for code files.  If omitted a default is used.

side effects

Checks that local files are in sync with repository and, if not, prints the svn command needed to sync. [Alt:  Could do svn 'checkout' or 'update' on user's behalf.]

 Updates the Code object (to be returned) with the current repository version. Downloads code files to directory(ies) under the 'local root'

returns

Code object

loadEntity(codeObj)

parameters

codeObj

side effects

If (codeId!=null)

...

  • Check that Version in R Code object is up-to-date with repository, and revises the R Code object if not. 
  • Check that the Version in Synapse Code object is up-to-date, and revises it if not.
  • Get current Step. 
  • Adds reference to Synapse Code object into Step.

...

codeId: ID of the object in Synapse

side effects

Delete metadata from Synapse.Print out delete command that user should execute.[Alt: Delete from the code repository.]

Deletes files from S3. 

returns

Nothing.

TODO: What if not all steps are successful?
TODO: Should we delete from the local disk? From the R session?

TODO: Can we defer the convenience function for loading a specific code version?

Scenarios

Discover, retrieve and download code.

...

and begins by executing this in R.

(Note:  "Repo" is the code repository client.  The interaction between the repository client and server is not shown.)

Discover, retrieve and load code into R session

...

Retrieve existing code, modify and save.

...