Git Product home page Git Product logo

Comments (13)

lzbj avatar lzbj commented on June 7, 2024

@paulcastro ,very interesting features, please split it into smaller issues, so we could help if possible.

from openwhisk-wskdeploy.

paulcastro avatar paulcastro commented on June 7, 2024

When someone pushes a package to a repo, there should be a default package name for it that is unique. We currently don't have a scheme for this though we could borrow from other dependency management frameworks. For instance, we could use a URL as the canonical name for the package.

When someone integrates a package from a repo, they should have the option to override the default name.

An example of support for this kind of model is how Go treats imports.

from openwhisk-wskdeploy.

lionelvillard avatar lionelvillard commented on June 7, 2024

After weighting several options, I would use a shorten (no protocol) URL as the canonical name for the package as you suggested. This has several advantages:

  • it is unique
  • no need to override the default name to avoid conflict
  • no need to go through a global naming service to guarantee the package name uniqueness
  • easier server-side deployment
  • the name can be used to directly locate the source code

The only minor problem is the package name cannot contains / characters, which has a simple solution.

from openwhisk-wskdeploy.

paulcastro avatar paulcastro commented on June 7, 2024

Thinking about package bindings, perhaps something like this:

package:
   name: myPackage
   dependencies:
           cloudant:
                  version 1.2
                  location: /whisk.system/cloudant
                  binding-name: myCloudant
                  inputs: 
                         param1: value1

The above assumes there is an OpenWhisk package called Cloudant, it's location is "whisk.system", and I want to refer to it as myCloudant inside this manifest file.

I'm not sure how to handle name uniqueness for package names. One option is to follow go's model, and use an internet style name based on whisk.system or GitHub repos:

package:
   name: myPackage
   dependencies:
           /whisk.system/cloudant:
                  version 1.2
                  binding-name: myCloudant
                  inputs: 
                         param1: value
          github.com/openwhisk/openwhisk-client-swift
                  version .02.2
                  binding-name: mySwift

If you don't specify a binding-name, then you refer to the package using whatever the package itself specifies, e.g. /whisk.system/cloudant refers to itself as "cloudant" in its package manifest.

from openwhisk-wskdeploy.

paulcastro avatar paulcastro commented on June 7, 2024

Another option is to specify the binding name upfront, and not have a binding-name key.

package:
   name: myPackage
   dependencies:
           myCloudant:
                  version 1.2
                  location: /whisk.system/cloudant
                  inputs: 
                         param1: value1
          mySwift:
                  location:  github.com/openwhisk/openwhisk-client-swift

If I want to use the default name (i.e. not specify a binding) then I just use the default name:

package:
   name: myPackage
   dependencies:
           cloudant:
                  version 1.2
                  location: /whisk.system/cloudant
                  inputs: 
                         param1: value1

from openwhisk-wskdeploy.

lionelvillard avatar lionelvillard commented on June 7, 2024

For uniqueness, see #41 (comment)

The first option does not work, as property keys in YAML must be unique and the same package can be bound multiple times. Option 2 might be clearer.

from openwhisk-wskdeploy.

lzbj avatar lzbj commented on June 7, 2024

so we are all agree with this solution #41 (comment), Ok, i'll investigate it and put it a high prio one, as our 101 use cases need to use dependencies. @paulcastro , are you already on this one, as I see you assigned yourself.

from openwhisk-wskdeploy.

paulcastro avatar paulcastro commented on June 7, 2024

@lzbj I can reassign to you - thanks. We agree on option 2 (see below).

For iteration 1: we will only support binding so the location value should be the package we are binding to. This will support the 101 use case.

In the next iteration, we can add support for location being a remote GitHub URL.

package:
   name: myPackage
   dependencies:
           myCloudant:
                  version 1.2
                  location: /whisk.system/cloudant
                  inputs: 
                         param1: value1
          mySwift:
                  location:  github.com/openwhisk/openwhisk-client-swift

from openwhisk-wskdeploy.

lzbj avatar lzbj commented on June 7, 2024

Ok, sure, got it. thanks.

from openwhisk-wskdeploy.

paulcastro avatar paulcastro commented on June 7, 2024

I tried using url and source as keys to distinguish between GitHub and system bindings. I'm not 100% this is correct and may refactor to overload location with two meanings per the previous example.

package:
   name: myPackage
   dependencies:
           myCloudant:
                  version 1.2
                  source: /whisk.system/cloudant
                  inputs: 
                         param1: value1
          mySwift:
                  url:  https://github.com/openwhisk/openwhisk-client-swift

from openwhisk-wskdeploy.

paulcastro avatar paulcastro commented on June 7, 2024

I'm updating over the code to support the original format using location without prefixes:

package:
   name: myPackage
   dependencies:
           myCloudant:
                  version 1.2
                  location: /whisk.system/cloudant
                  inputs: 
                         param1: value1
          mySwift:
                  location:  github.com/openwhisk/openwhisk-client-swift```

from openwhisk-wskdeploy.

mrutkows avatar mrutkows commented on June 7, 2024

@paulcastro opened #259 to track spec. updates for dependencies.

from openwhisk-wskdeploy.

paulcastro avatar paulcastro commented on June 7, 2024

merged

from openwhisk-wskdeploy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.