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

✨ Feature ➾ Allow docker images to be overwritten via environment variable (#1425) #1445

Merged
merged 15 commits into from
Nov 17, 2022

Conversation

mweichert
Copy link
Collaborator

@mweichert mweichert commented Nov 3, 2022

🌮 Taqueria PR

🪁 Description

There are four plugins currently which use docker images to facilitate their functionality:

  • ligo plugin
  • archetype plugin
  • flextesa plugin
  • tezos-client plugin

🪂 Pre-Merge Checklist (Definition of Done)

🚦 Required to merge:

  • ⛱️ I have completed this PR template in full and updated the title appropriately
  • ⛵ My code builds cleanly, and I have manually tested the changes
  • 🏄‍♂️ Another team member has built this branch and done manual testing on the change
  • 🏖️ New and existing unit tests pass locally and in CI
  • 🔱 The test plan has been implemented and verified by an SDET
  • 🦀 Automated tests have been written and added to this PR
  • 🐬 I have commented my code, particularly in hard-to-understand areas
  • 🤿 Corresponding changes have been made to all documentation
  • 🐚 Required changes to the VScE have been made
  • 🪸 Required updates to scaffolds have been made
  • 🚢 The release checklist has been completed

🛩️ Summary of Changes

Users were looking for the ability to override the docker image being used. This is a common request in CICD, and thus we opted to allow overrides using environment variables. This is not mutually exclusive from adding an option later to allow specifying version #s in the config file, such as the ligo version.

🎢 Test Plan

  • I introduced a new function in the SDK called getDockerImage, and added a unit test for it in taqueria-sdk.spec.ts
  • For each plugin, I added a test case to assure that each plugin could have a custom image specified using a plugin. To do this, I added a hidden task for each plugin called get-image that our tests can use to verify what image is being used.

🛸 Type of Change

  • 🧽 Chore ➾
  • 🛠️ Fix ➾
  • ✨ Feature ➾
  • 👷 Refactor ➾
  • 🧪 Pre-Release ➾
  • 🚀 Release ➾

@mweichert mweichert requested a review from a team November 3, 2022 14:35
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 3, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 41224d3
Status: ✅  Deploy successful!
Preview URL: https://ac57f531.taqueria.pages.dev
Branch Preview URL: https://1425-docker-overrides.taqueria.pages.dev

View logs

@mweichert mweichert changed the title Fixes #1425, allows docker images to be specified by environment variable ✨ Feature ➾ Allow docker images to be overwritten via environment variable (#1425) Nov 3, 2022
@mweichert mweichert linked an issue Nov 3, 2022 that may be closed by this pull request
11 tasks
@mweichert mweichert self-assigned this Nov 3, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2022

Latest Commit 41224d3
Taq Binaries

Linux
MacOS
Windows

npm Packages

npm i @taqueria/plugin-archetype@0.22.2-1445.41224d34 --registry https://npm.ecadinfra.com
npm i @taqueria/plugin-contract-types@0.22.2-1445.41224d34 --registry https://npm.ecadinfra.com
npm i @taqueria/plugin-core@0.22.2-1445.41224d34 --registry https://npm.ecadinfra.com
npm i @taqueria/plugin-flextesa@0.22.2-1445.41224d34 --registry https://npm.ecadinfra.com
npm i @taqueria/plugin-ipfs-pinata@0.22.2-1445.41224d34 --registry https://npm.ecadinfra.com
npm i @taqueria/plugin-jest@0.22.2-1445.41224d34 --registry https://npm.ecadinfra.com
npm i @taqueria/plugin-ligo@0.22.2-1445.41224d34 --registry https://npm.ecadinfra.com
npm i @taqueria/plugin-metadata@0.22.2-1445.41224d34 --registry https://npm.ecadinfra.com
npm i @taqueria/plugin-smartpy@0.22.2-1445.41224d34 --registry https://npm.ecadinfra.com
npm i @taqueria/plugin-taquito@0.22.2-1445.41224d34 --registry https://npm.ecadinfra.com
npm i @taqueria/plugin-tezos-client@0.22.2-1445.41224d34 --registry https://npm.ecadinfra.com
npm i @taqueria/protocol@0.22.2-1445.41224d34 --registry https://npm.ecadinfra.com
npm i @taqueria/node-sdk@0.22.2-1445.41224d34 --registry https://npm.ecadinfra.com
npm i @taqueria/state@0.22.2-1445.41224d34 --registry https://npm.ecadinfra.com
npm i @taqueria/toolkit@0.22.2-1445.41224d34 --registry https://npm.ecadinfra.com
npm i @0.22.2-1445.41224d34 --registry https://npm.ecadinfra.com

VSCode Extension VSIX

taqueria-vscode-1425-docker-overrides-ubuntu-latest

@ac10n
Copy link
Contributor

ac10n commented Nov 3, 2022

One general question?
Why do we enable this through environment variables and not by optional settings in config.json?

Copy link
Contributor

@jchenche jchenche left a comment

Choose a reason for hiding this comment

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

Some e2e tests are failing. Can we address those first?

@mweichert
Copy link
Collaborator Author

One general question? Why do we enable this through environment variables and not by optional settings in config.json?

@AlirezaHaghshenas somehow I missed your comment here. It was thought that this would be easiest for CI/CD setups. However, I don't think this is mutually exclusive from also offering the ability override by config. I think that's a great idea too. But this was just meant to resolve a particular use-case.

Copy link
Contributor

@jchenche jchenche left a comment

Choose a reason for hiding this comment

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

This PR is outdated. Can you merge main in and resolve all conflicts?

taqueria-plugin-ligo/compile.ts Outdated Show resolved Hide resolved
@hu3man hu3man requested a review from jchenche November 16, 2022 19:20
@@ -18,7 +19,7 @@ export type IntersectionOpts = LigoOpts & CompileOpts & TestOpts;
type UnionOpts = LigoOpts | CompileOpts | TestOpts;

// Points to the latest stable version. Needs to update this as part of our release process
export const LIGO_DOCKER_IMAGE = 'ligolang/ligo:0.55.0';
export const LIGO_DOCKER_IMAGE = getDockerImage('ligolang/ligo:0.55.0', 'TAQ_LIGO_IMAGE');
Copy link
Contributor

Choose a reason for hiding this comment

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

It is easier to reason and reduces cognitive overhead to only assign literals to global constants

Copy link
Contributor

@ac10n ac10n left a comment

Choose a reason for hiding this comment

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

LGTM.

I would personally be happier if we had not created the get-image tasks.

Is there an end-user use-case for those?

@mweichert
Copy link
Collaborator Author

LGTM.

I would personally be happier if we had not created the get-image tasks.

Is there an end-user use-case for those?

It's just to verify what docker image is used by a particular plugin, just in case you need to double check. I believe I made these tasks hidden from the UI.

@hu3man hu3man requested a review from jchenche November 16, 2022 23:43
Copy link
Contributor

@jchenche jchenche left a comment

Choose a reason for hiding this comment

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

LGMT!

@hu3man hu3man merged commit 3460d4c into main Nov 17, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Nov 17, 2022
@hu3man hu3man deleted the 1425-docker-overrides branch December 8, 2022 09:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🚧 Dev ➾ Provide a means of overriding all docker images
5 participants