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

[BUG] Wadm does not allow me to use the same provider with another component. #296

Closed
2 of 9 tasks
ritesh089 opened this issue Jun 3, 2024 · 2 comments · Fixed by #303
Closed
2 of 9 tasks

[BUG] Wadm does not allow me to use the same provider with another component. #296

ritesh089 opened this issue Jun 3, 2024 · 2 comments · Fixed by #303
Labels
bug Something isn't working

Comments

@ritesh089
Copy link
Contributor

Affected project(s)

  • documentation
  • examples
  • wasmCloud host
  • wasmCloud CLI (wash)
  • wasmCloud dashboard UI (washboard)
  • capability providers
  • provider bindgen
  • control interface client
  • other / not sure

Describe the bug

wash does not allow me to deploy the same provider with a second component that has its own wadm.
returns the error :

Provider file:///Users/****/Documents/wasm-dependencies/http-server-provider.par.gz is already deployed with a different version in http-component.

wash app status for the second component is undeployed .

Name               Latest Version   Deployed Version   Deploy Status   Description
  http-component     v0.0.1           v0.0.1                  Deployed   HTTP hello world demo in Rust, showing use of the server and client providers
  rust-hello-world   v0.0.1           N/A                   Undeployed   HTTP hello world demo in Rust, using the WebAssembly Component Model and WebAssembly Interfaces Types (WIT)

Note : I did use a different port for the second component , but the same provider.

Steps to reproduce

  1. wash up --wadm-version 0.11.2

  2. wash app deploy wadm.yaml (for component1)

  3. build component 2 : wash build

  4. wash app deploy wadm.yaml (for component 2)

Wadm file : component 1

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
  name: http-component
  annotations:
    version: v0.0.1
    description: 'HTTP hello world demo in Rust, showing use of the server and client providers'
spec:
  components:
    - name: http-component
      type: component
      properties:
        image: file://./build/http_component_s.wasm
      traits:
        # Govern the spread/scheduling of the component
        - type: spreadscaler
          properties:
            replicas: 1
        - type: link
          properties:
            target: httpclient
            namespace: wasi
            package: http
            interfaces: [outgoing-handler]

    # Add a capability provider that enables HTTP access
    - name: httpserver
      type: capability
      properties:
        image: file:///Users/****/Documents/wasm-dependencies/http-server-provider.par.gz
      traits:
        # Link the httpserver to the component, and configure the HTTP server
        # to listen on port 8080 for incoming requests
        - type: link
          properties:
            target: http-component
            namespace: wasi
            package: http
            interfaces: [incoming-handler]
            source_config:
              - name: default-http
                properties:
                  address: 127.0.0.1:8080

    - name: httpclient
      type: capability
      properties:
        image: file:///Users/****/Documents/wasm-dependencies/http-client-provider.par.gz

Wadm (component-2)

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
  name: rust-hello-world
  annotations:
    version: v0.0.1
    description: "HTTP hello world demo in Rust, using the WebAssembly Component Model and WebAssembly Interfaces Types (WIT)"
spec:
  components:
    - name: http-component
      type: component
      properties:
        image: file://./build/http_hello_world_s.wasm
      traits:
        - type: link
          properties:
            target: custom-provider
            namespace: wasmcloud
            package: example
            interfaces: [system-info]
        # Govern the spread/scheduling of the component
        - type: spreadscaler
          properties:
            replicas: 1

    # Add a capability provider that enables HTTP access
    - name: httpserver
      type: capability
      properties:
        image: file:///Users/****/Documents/wasm-dependencies/http-server-provider.par.gz
      traits:
        # Link the httpserver to the component, and configure the HTTP server
        # to listen on port 8085 for incoming requests
        - type: link
          properties:
            target: http-component
            namespace: wasi
            package: http
            interfaces: [incoming-handler]
            source_config:
              - name: default-http
                properties:
                  address: 127.0.0.1:8085

    - name: custom-provider
      type: capability
      properties:
        image: file://../mycustom-provider/build/wasmcloud-provider-custom-template.par.gz
        id: custom-provider
        config:
          - name: provider-config
            properties:
              foo: bar

Expected behavior

I expect both components to be deployed with the http-server capability provider.

Environment

  • OS: [e.g. Linux, MacOS]
  • Shell [e.g. bash, zsh, powershell]
  • wasmcloud Version [e.g. 0.81.0]

Screenshots / Logs / Additional context

No response

@ritesh089 ritesh089 added the bug Something isn't working label Jun 3, 2024
@brooksmtownsend brooksmtownsend transferred this issue from wasmCloud/wasmCloud Jun 3, 2024
@brooksmtownsend
Copy link
Member

Transferring issue over to the wadm repository, let me see if I can reproduce here...

@brooksmtownsend
Copy link
Member

brooksmtownsend commented Jun 3, 2024

I can reproduce with two different versions of the same provider.

/dog-fetcher ➜ cat wadm.yaml|grep http-server
        image: ghcr.io/wasmcloud/http-server:0.20.1
/http-hello-world ➜ cat wadm.yaml|grep http-server
        image: ghcr.io/wasmcloud/http-server:0.20.0

➜ wash app deploy ./wadm.yaml

Provider ghcr.io/wasmcloud/http-server:0.20.1 is already deployed with a different version in rust-hello-world.

This is an unintended leftover bit of validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants