Skip to content

Add Dockerfile and Github Action #4

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

Merged
merged 7 commits into from
Nov 14, 2021
Merged

Add Dockerfile and Github Action #4

merged 7 commits into from
Nov 14, 2021

Conversation

erancx
Copy link
Contributor

@erancx erancx commented Nov 11, 2021

This will allow CI for creating Docker images on push.
Should be changed from push to pull_request once we feel more
comfortable with the solution.

This will allow CI for creating Docker images on push.
Should be changed from push to pull_request once we feel more
comfortable with the solution.
@erancx erancx requested a review from SEJeff November 11, 2021 09:21
@erancx erancx changed the title Add Dockerfile and Github Action. Add Dockerfile and Github Action Nov 11, 2021
Eran Davidovich added 5 commits November 11, 2021 11:25
This will allow CI for creating Docker images on push.
Should be changed from push to pull_request once we feel more
comfortable with the solution.
This will allow CI for creating Docker images on push.
Should be changed from push to pull_request once we feel more
comfortable with the solution.
This will allow CI for creating Docker images on push.
Should be changed from push to pull_request once we feel more
comfortable with the solution.
Copy link
Contributor

@SEJeff SEJeff left a comment

Choose a reason for hiding this comment

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

Some minor comments inline, let me know what you think good sir.

@@ -0,0 +1,30 @@
name: Build Docker image

on: [push]
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd think we'd only want images pushed when tags are created, not on every push, WDYT?

Assumptions

Once #3 is merged, we will have the start of unit tests for this library. The repo will have PRs required via branch protections on the main branch with one approved review. This can be enforced in the pyth-network/pyth-terraform repo.

Developer Submitting A New Change

Developer workstation --> Push to forked repo --> Create a PR against this repo

Some actions run that do pip install -e '.[testing]' and then pytest run to ensure there are no regressions. An action like this one would show test coverage as a comment on the PR.

The image created for running the unit tests is ephemeral and will not be pushed to docker hub. This means the release images will not have extra dependencies for running tests, as that is unnecessary.

Developer Making A New Release

The developer doing this must have Write privileges to this repo.

Developer workstation--> git push --tags --> the below actions run, create an image, and push it to docker hub.

In the future, we can have a required ChangeLog, along with actions to create a new release that gets created here on github AND pushed to pypi. The magical command to create the python source release is python setup.py sdist

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. Regarding the push, this PR is a WIP and I intend to change it to on submit only.
  2. We would need to different tasks, one for running tests and following by image build. They will be triggered on branch changes only
  3. We don't have branch protection on our Github account, we'll need to upgrade it for using protection but definitely a requirement for us!

I completely agree with all your notes. I'll make sure to adjust our code to reflect that.

with:
platforms: linux/amd64
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/pyth-client-py:latest
Copy link
Contributor

Choose a reason for hiding this comment

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

And when we have this done via tags, we can have an action to just create the docker image with the same version as the library.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, actually this PR is only a WIP, was looking to get it built and then create a proper k8s deployment. but note taken, this should definitely be an application version rather than tag.

Co-authored-by: Jeff Schroeder <jschroeder@jumptrading.com>
Copy link
Contributor

@SEJeff SEJeff left a comment

Choose a reason for hiding this comment

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

This is a really kickass WIP btw. Feel free to edit it as you see fit and merge at will.

@erancx erancx merged commit 34b30dc into main Nov 14, 2021
@erancx erancx deleted the feat/docker_image branch November 14, 2021 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants