Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

feat(jfrog): add JFrog vscode extension, CLI completion and docker support #115

Merged
merged 53 commits into from
Jan 5, 2024

Conversation

matifali
Copy link
Member

@matifali matifali commented Dec 25, 2023

  1. Adds JFrog extension configuration and installation.
  2. Add support for configuring docker.
  3. Adapt .npmrc to work with version >=9
  • Check for docker command before the docker login

Related coder/coder#11338

@matifali matifali self-assigned this Dec 25, 2023
@matifali matifali requested review from mafredri and bpmct December 25, 2023 15:52
@matifali matifali changed the title feat(jfrog): add JFrog extension configuration feat(jfrog): add JFrog vscode extension Dec 27, 2023
if [ "${CONFIGURE_CODE_SERVER}" == "true" ]; then
while ! [ -x /tmp/code-server/bin/code-server ]; do
counter=0
if [ $counter -eq 30 ]; then
Copy link
Member

Choose a reason for hiding this comment

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

For an arbitrary timeout, this feels a bit short (slow network, hiccup, etc). It'd nice to communicate between modules since we're already assuming the path (/tmp/code-server). Perhaps we could have the code-server module write an install status file instead, like touch /tmp/.code-server_installing, touch /tmp/.code-server_done and touch /tmp/.code-server_failed. Then we simply check for the presence of these files while we wait.

Also, are we sure that once this file is present, running it won't fail? Could it be incomplete (still copying), missing a resource file it requires, etc? (This also paints a case for the aforementioned suggestion.)

As a perhaps better alternative, it would be pretty nice to be able to define script dependencies in the modules, e.g. code server module script runs before this one, etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, I agree. Having a mechanism for dependence is probably the best base. For now we can modify the code-server module to create status files. I am not sure how we can check the insatlling status.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also, should we condition the part of the module or the whole module? I think your idea can be extended to have a common input for all modules depends_on = module_name where we check for file /tmp/.${module_name}-success before we start runing coder_script

Copy link
Member

@mafredri mafredri Jan 2, 2024

Choose a reason for hiding this comment

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

If there's a way to reference another modules resource, I think that would work well for this use case. But I'm not sure how terraform would behave in this case. Maybe we need both a module and a script level dependency so that terraform can exit early if only one module is used without its dependency?

Or do we automatically pull in dependencies without them being explicitly declared?

Anyway, as for how the script part might look, maybe something like this?

// code-server
resource "coder_script" "install" {}

// my-module
resource "coder_script" "takes_a_while" {}

resource "coder_script" "finalize" {
	depends_on = [code-server.coder_script.install, coder_script.takes_a_while]
}

Again, if we can refer like this, it'd be ideal, otherwise we may need to use strings and define the dependency in runtime? Perhaps it would be a good idea to think about what other use-cases we have, and maybe write a proposal? This might also tie a little bit into coder/coder#11131?

Copy link
Member

@bpmct bpmct Jan 3, 2024

Choose a reason for hiding this comment

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

In the meantime, I'd rather not use status files, but instead wait for the process to be started or a successful curl or something.

I do like us eventually using depends_on though or some other way to wait.

Copy link
Member Author

@matifali matifali Jan 4, 2024

Choose a reason for hiding this comment

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

For now I am going to merge them without any modification until we have a formal way to resolve #93.

@matifali matifali changed the title feat(jfrog): add JFrog vscode extension and handle npm >= 9 feat(jfrog): add JFrog vscode extension, CLI completion and docker support Jan 2, 2024
@bpmct
Copy link
Member

bpmct commented Jan 3, 2024

Will this break old versions of the module? If so, would like to hold off until we add support for versioning

@matifali
Copy link
Member Author

matifali commented Jan 4, 2024

@bpmct I tried to make it so as not to break old versions by not introducing any new required variables or renaming previous variables.

@matifali matifali merged commit 357bd41 into main Jan 5, 2024
@matifali matifali deleted the jfrog-code-server-extension branch January 5, 2024 14:41
@matifali matifali restored the jfrog-code-server-extension branch January 5, 2024 14:41
@matifali matifali deleted the jfrog-code-server-extension branch October 17, 2024 13:51
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.

3 participants