Automatic deployment of SymPy Live/Gamma

51 views
Skip to first unread message

David Li

unread,
Mar 11, 2014, 4:26:52 PM3/11/14
to sy...@googlegroups.com
Hello all,

Based on Paul Kinlan's blog post I have forked and updated the "Github-Auto-Deploy" server to deploy SymPy Live/SymPy Gamma. My fork is at https://github.com/lidavidm/Github-Auto-Deploy; it uses Python 3 and has some other changes detailed below.

How it works:
  • The server is configured with the location of the local repository, the deploy scripts, etc. (see the configuration file)
  • On the repository a webhook is set up to point to the server.
  • Any commit will be sent as a POST request to the server.
  • The server (this is different from the original) filters for a commit message matching "Bump version to [0-9]+" (specified in the configuration file), at which point it pulls changes from remote.
  • The deploy script uses the App Engine SDK to deploy.
    • This uses OAuth so we only have to sign in once.
    • The deploy script has access to environment variables set by the server/configuration so we don't have to hardcode the SDK location in the script.
Some work is still needed: the server doesn't verify that the request is from Github. Also, the project has no license, so it's unclear if we can use it or not.

The server can be tested locally with instructions from Github: run the server, then use ngrok to expose the local server to the Internet. On Github's webhook page (in the repository settings), add the ngrok URL as a webhook and set the payload version to JSON (this also differs from the original server)

David

Aaron Meurer

unread,
Mar 12, 2014, 6:07:22 PM3/12/14
to sy...@googlegroups.com
This is good. We will be able to be much more agile with changes to
Live and Gamma with this.


On Tue, Mar 11, 2014 at 3:26 PM, David Li <li.da...@gmail.com> wrote:
> Hello all,
>
> Based on Paul Kinlan's blog post I have forked and updated the
> "Github-Auto-Deploy" server to deploy SymPy Live/SymPy Gamma. My fork is at
> https://github.com/lidavidm/Github-Auto-Deploy; it uses Python 3 and has
> some other changes detailed below.
>
> How it works:
>
> The server is configured with the location of the local repository, the
> deploy scripts, etc. (see the configuration file)
> On the repository a webhook is set up to point to the server.
> Any commit will be sent as a POST request to the server.
> The server (this is different from the original) filters for a commit
> message matching "Bump version to [0-9]+" (specified in the configuration
> file), at which point it pulls changes from remote.
> The deploy script uses the App Engine SDK to deploy.
>
> This uses OAuth so we only have to sign in once.
> The deploy script has access to environment variables set by the
> server/configuration so we don't have to hardcode the SDK location in the
> script.
>
> Some work is still needed: the server doesn't verify that the request is
> from Github. Also, the project has no license, so it's unclear if we can use
> it or not.

That shouldn't be an issue, even if it has an incompatible license, as
we are not incorporating the code with Live.

Aaron Meurer

>
> The server can be tested locally with instructions from Github: run the
> server, then use ngrok to expose the local server to the Internet. On
> Github's webhook page (in the repository settings), add the ngrok URL as a
> webhook and set the payload version to JSON (this also differs from the
> original server)
>
> David
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/ee8ae420-56ce-4c61-b3a8-588afb4fe6e9%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

David Li

unread,
Apr 20, 2014, 9:21:51 PM4/20/14
to sy...@googlegroups.com
Okay. So we have some other options:

  • Google provides Push to Deploy, which automatically deploys a linked repository whenever it is pushed to. Unfortunately this doesn't work with submodules and Google refuses to support them. They suggest using git-subtree instead, so we would have to convert our submodules into subtrees.
  • Travis-CI provides a deploy step; the SDK would have to be downloaded as part of this.
Which option would be best?

David

SAHIL SHEKHAWAT

unread,
Apr 20, 2014, 9:25:26 PM4/20/14
to sy...@googlegroups.com

+1 :D

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.

Ondřej Čertík

unread,
Apr 21, 2014, 1:32:28 AM4/21/14
to sympy
On Sun, Apr 20, 2014 at 7:21 PM, David Li <li.da...@gmail.com> wrote:
> Okay. So we have some other options:
>
> Google provides Push to Deploy, which automatically deploys a linked
> repository whenever it is pushed to. Unfortunately this doesn't work with
> submodules and Google refuses to support them. They suggest using
> git-subtree instead, so we would have to convert our submodules into
> subtrees.

I would keep using submodules, that should keep the repository small.
But maybe we can create a new repository just for pushing to the appengine,
that would get updated by either Travis or some other service like
Shippable (see below),
and it would contain the merged git subtree.

> Travis-CI provides a deploy step; the SDK would have to be downloaded as
> part of this.

That should work. There are also other services that allow deployment, e.g.:

https://www.shippable.com/
http://docs.shippable.com/en/latest/config.html#continuous-deployment

Ondrej
Reply all
Reply to author
Forward
0 new messages