Skip to content
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

deploy refactor #22

Merged
merged 9 commits into from
Jul 27, 2022
Merged

deploy refactor #22

merged 9 commits into from
Jul 27, 2022

Conversation

mrharpo
Copy link
Contributor

@mrharpo mrharpo commented Jul 22, 2022

Deploy

Refactord deployer.py to reduce repition

  • DRY base functions (outside class)
    • build_image(repo_name, tag, src)
      • Note: src - Because we might want to build from a source repo with tag or build only from local files:
      • The src arg is when the docker build source needs to be different than the name of the repo
        • (ov_wag, ov-front) build image from repo#tag
        • (ov-nginx, jumpbox) build image from local files
    • push_image(repo_name, tag)
    • update_workload(pod, tag)
  • self._deploy()
    • deploy steps for single image
      • build
      • push
      • update
  • self.deploy()
    • calls underlying _deploy() with custom args for each
  • Adds cli string arg for --ov-nginx
  • Migrates pydantic model to use ov_nginx: str

Closes #19

@mrharpo mrharpo added documentation 📜 Improvements or additions to documentation CD 🏗️ Relating to Continuous Deployment maintenance 🔧 Updates and upgrades labels Jul 22, 2022
@mrharpo mrharpo added this to the v0.2.0 Deploy 🌇 milestone Jul 22, 2022
@mrharpo mrharpo self-assigned this Jul 22, 2022
@mrharpo mrharpo mentioned this pull request Jul 25, 2022
12 tasks
@mrharpo mrharpo requested a review from afred July 27, 2022 17:45
Copy link
Contributor

@afred afred left a comment

Choose a reason for hiding this comment

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

👍

@afred afred marked this pull request as draft July 27, 2022 19:39
print(f'Starting deployment using context "{self.context}"')

if not any([self.ov_wag, self.ov_frontend, self.ov_nginx]):
raise Exception(f'Nothing specified for deployment.')
if self.ov_wag:
self.deploy_ov_wag()
self._deploy('ov-wag', self.ov_wag, src=f'{OV_WAG_URL}#{self.ov_wag}')
Copy link
Contributor

Choose a reason for hiding this comment

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

@mrharpo does this mean src will always be used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but it's not needed in the nginx deploy, so we could remove it there.

self._deploy(
'ov-frontend',
self.ov_frontend,
src=f'{OV_FRONT_URL}#{self.ov_frontend}',
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto above

deployer.py Outdated
if self.ov_nginx:
self.deploy_ov_nginx()
self._deploy('ov-nginx', self.ov_nginx, src='ov-nginx')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unnecessary here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we were to split ov-nginx into it's own repo, we would need to explicitly point the src to the github repo.

When we add the jumpbox options to the CLI, it will not need the src since it's building from a local file... until we split it into it's own repo.

Copy link
Contributor

@afred afred left a comment

Choose a reason for hiding this comment

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

👍

@mrharpo mrharpo marked this pull request as ready for review July 27, 2022 20:34
Copy link
Contributor

@afred afred left a comment

Choose a reason for hiding this comment

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

👍

@afred afred merged commit c56a117 into main Jul 27, 2022
@afred afred deleted the 19-deploy-refactor branch July 27, 2022 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CD 🏗️ Relating to Continuous Deployment documentation 📜 Improvements or additions to documentation maintenance 🔧 Updates and upgrades
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

ov-nginx deployment steps
2 participants