You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "denisbr (via GitHub)" <gi...@apache.org> on 2023/04/17 09:59:55 UTC

[GitHub] [camel-k-examples] denisbr opened a new issue, #77: 02-serverless-api example fails

denisbr opened a new issue, #77:
URL: https://github.com/apache/camel-k-examples/issues/77

   I fixed the CLI invocation (See https://github.com/apache/camel-k-examples/pull/76) but after that I still have issues getting `02-serverless-api` to work:
   
   ```
   ❯ kamel run API.java --open-api file:openapi.yaml --source test/MinioCustomizer.java --property file:test/minio.properties
   Modeline options have been loaded from source files
   Full command: kamel run API.java --open-api file:openapi.yaml --source test/MinioCustomizer.java --property file:test/minio.properties --dependency=camel-quarkus-openapi-java
   Warning: dependency camel:openapi-java not found in Camel catalog
   Integration "api" created
   ❯ kubectl get integrations
   NAME   PHASE            KIT   REPLICAS
   api    Initialization
   ```
   After a long wait it inevitably ends up in: 
   ```
   ❯ kubectl get integrations
   NAME   PHASE   KIT   REPLICAS
   api    Error
   ```
   
   I pre-checked all requirements (have kamel and knative configured correctly, and the readme.md verification reports AOK).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] 02-serverless-api example fails [camel-k-examples]

Posted by "bvahdat (via GitHub)" <gi...@apache.org>.
bvahdat closed issue #77: 02-serverless-api example fails 
URL: https://github.com/apache/camel-k-examples/issues/77


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k-examples] squakez commented on issue #77: 02-serverless-api example fails

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on issue #77:
URL: https://github.com/apache/camel-k-examples/issues/77#issuecomment-1514800039

   I think the API.java modeline has some error as well. Likely `dependency=camel-quarkus-openapi-java` should be removed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k-examples] denisbr commented on issue #77: 02-serverless-api example fails

Posted by "denisbr (via GitHub)" <gi...@apache.org>.
denisbr commented on issue #77:
URL: https://github.com/apache/camel-k-examples/issues/77#issuecomment-1511055762

   Better output: (`kubectl get integrations -o json`) 
   
   ```json
   {
       "apiVersion": "v1",
       "items": [
           {
               "apiVersion": "camel.apache.org/v1",
               "kind": "Integration",
               "metadata": {
                   "annotations": {
                       "camel.apache.org/operator.id": "camel-k"
                   },
                   "creationTimestamp": "2023-04-17T09:52:32Z",
                   "generation": 1,
                   "name": "api",
                   "namespace": "camel-api",
                   "resourceVersion": "57647",
                   "uid": "889fcb1a-d116-45a2-9972-93312da1b442"
               },
               "spec": {
                   "dependencies": [
                       "camel:openapi-java"
                   ],
                   "sources": [
                       {
                           "content": "// camel-k: language=java dependency=camel-quarkus-openapi-java \n\nimport org.apache.camel.builder.AggregationStrategies;\nimport org.apache.camel.builder.RouteBuilder;\n\npublic class API extends RouteBuilder {\n  @Override\n  public void configure() throws Exception {\n\n    // All endpoints starting from \"direct:...\" reference an operationId defined\n    // in the \"openapi.yaml\" file.\n\n    // List the object names available in the S3 bucket\n    from(\"direct:list\")\n      .to(\"aws2-s3://{{api.bucket}}?operation=listObjects\")\n      .split(simple(\"${body}\"), AggregationStrategies.groupedBody())\n        .transform().simple(\"${body.key}\")\n      .end()\n      .marshal().json();\n\n\n    // Get an object from the S3 bucket\n    from(\"direct:get\")\n      .setHeader(\"CamelAwsS3Key\", simple(\"${header.name}\"))\n      .to(\"aws2-s3://{{api.bucket}}?operation=getObject\")\n      .convertBodyTo(String.class);\n\n\n    // Upload a n
 ew object into the S3 bucket\n    from(\"direct:create\")\n      .setHeader(\"CamelAwsS3Key\", simple(\"${header.name}\"))\n      .to(\"aws2-s3://{{api.bucket}}\")\n      .setBody().constant(\"\");\n\n\n    // Delete an object from the S3 bucket\n    from(\"direct:delete\")\n      .setHeader(\"CamelAwsS3Key\", simple(\"${header.name}\"))\n      .to(\"aws2-s3://{{api.bucket}}?operation=deleteObject\")\n      .setBody().constant(\"\");\n\n  }\n}\n",
                           "name": "API.java"
                       },
                       {
                           "content": "// camel-k: language=java\npackage test;\n\nimport org.apache.camel.BindToRegistry;\nimport org.apache.camel.PropertyInject;\n\nimport com.amazonaws.auth.AWSCredentials;\nimport com.amazonaws.auth.AWSCredentialsProvider;\nimport com.amazonaws.auth.AWSStaticCredentialsProvider;\nimport com.amazonaws.auth.BasicAWSCredentials;\nimport com.amazonaws.client.builder.AwsClientBuilder;\nimport com.amazonaws.services.s3.AmazonS3;\nimport com.amazonaws.services.s3.AmazonS3ClientBuilder;\n\npublic class MinioCustomizer {\n\n    @BindToRegistry\n    public static AmazonS3 minioClient(\n            @PropertyInject(\"minio.endpoint\") String endpointAddress,\n            @PropertyInject(\"minio.access-key\") String accessKey,\n            @PropertyInject(\"minio.secret-key\") String secretKey) {\n\n        AwsClientBuilder.EndpointConfiguration endpoint = new AwsClientBuilder.EndpointConfiguration(endpointAddress, \"US_EAST_1\");\n        AWSCredentials crede
 ntials = new BasicAWSCredentials(accessKey, secretKey);\n        AWSCredentialsProvider credentialsProvider = new AWSStaticCredentialsProvider(credentials);\n\n        return AmazonS3ClientBuilder\n            .standard()\n            .withEndpointConfiguration(endpoint)\n            .withCredentials(credentialsProvider)\n            .withPathStyleAccessEnabled(true)\n            .build();\n\n    }\n\n}\n",
                           "name": "MinioCustomizer.java"
                       }
                   ],
                   "traits": {
                       "camel": {
                           "properties": [
                               "api.bucket = camel-k",
                               "minio.endpoint = http://minio:9000",
                               "minio.access-key = minio",
                               "minio.secret-key = minio123",
                               "camel.context.rest-configuration.api-context-path = /openapi.json"
                           ]
                       },
                       "openapi": {
                           "configmaps": [
                               "cm-f5962d18f88b79e8dfd134f4cc6fb18c23cac9a6"
                           ]
                       }
                   }
               },
               "status": {
                   "capabilities": [
                       "rest"
                   ],
                   "conditions": [
                       {
                           "firstTruthyTime": "2023-04-17T09:52:32Z",
                           "lastTransitionTime": "2023-04-17T09:52:32Z",
                           "lastUpdateTime": "2023-04-17T09:52:32Z",
                           "message": "camel-api/camel-k",
                           "reason": "IntegrationPlatformAvailable",
                           "status": "True",
                           "type": "IntegrationPlatformAvailable"
                       },
                       {
                           "lastTransitionTime": "2023-04-17T09:57:32Z",
                           "lastUpdateTime": "2023-04-17T09:57:32Z",
                           "message": "error during trait customization: cannot generate configmap for openapi resource openapi.yaml: : signal: killed",
                           "reason": "InitializationFailed",
                           "status": "False",
                           "type": "Ready"
                       }
                   ],
                   "digest": "v5MwSqDsSKu9m3zon2A1bhVFZwNn2O4i53mfUeUpjzpc",
                   "observedGeneration": 1,
                   "phase": "Error",
                   "platform": "camel-k",
                   "profile": "Knative",
                   "runtimeProvider": "quarkus",
                   "runtimeVersion": "1.17.0"
               }
           }
       ],
       "kind": "List",
       "metadata": {
           "resourceVersion": ""
       }
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k-examples] denisbr commented on issue #77: 02-serverless-api example fails

Posted by "denisbr (via GitHub)" <gi...@apache.org>.
denisbr commented on issue #77:
URL: https://github.com/apache/camel-k-examples/issues/77#issuecomment-1511076512

   I updated the `openapi.yaml` and bumped the spec version to `3.0.3` then I get a different error:
   
   ```json
   {
       "apiVersion": "v1",
       "items": [
           {
               "apiVersion": "camel.apache.org/v1",
               "kind": "Integration",
               "metadata": {
                   "annotations": {
                       "camel.apache.org/operator.id": "camel-k"
                   },
                   "creationTimestamp": "2023-04-17T10:14:55Z",
                   "generation": 1,
                   "name": "api",
                   "namespace": "camel-api",
                   "resourceVersion": "63621",
                   "uid": "649e20a1-96fc-42fe-bc92-87e8b06244ca"
               },
               "spec": {
                   "dependencies": [
                       "camel:openapi-java"
                   ],
                   "sources": [
                       {
                           "content": "// camel-k: language=java dependency=camel-quarkus-openapi-java \n\nimport org.apache.camel.builder.AggregationStrategies;\nimport org.apache.camel.builder.RouteBuilder;\n\npublic class API extends RouteBuilder {\n  @Override\n  public void configure() throws Exception {\n\n    // All endpoints starting from \"direct:...\" reference an operationId defined\n    // in the \"openapi.yaml\" file.\n\n    // List the object names available in the S3 bucket\n    from(\"direct:list\")\n      .to(\"aws2-s3://{{api.bucket}}?operation=listObjects\")\n      .split(simple(\"${body}\"), AggregationStrategies.groupedBody())\n        .transform().simple(\"${body.key}\")\n      .end()\n      .marshal().json();\n\n\n    // Get an object from the S3 bucket\n    from(\"direct:get\")\n      .setHeader(\"CamelAwsS3Key\", simple(\"${header.name}\"))\n      .to(\"aws2-s3://{{api.bucket}}?operation=getObject\")\n      .convertBodyTo(String.class);\n\n\n    // Upload a n
 ew object into the S3 bucket\n    from(\"direct:create\")\n      .setHeader(\"CamelAwsS3Key\", simple(\"${header.name}\"))\n      .to(\"aws2-s3://{{api.bucket}}\")\n      .setBody().constant(\"\");\n\n\n    // Delete an object from the S3 bucket\n    from(\"direct:delete\")\n      .setHeader(\"CamelAwsS3Key\", simple(\"${header.name}\"))\n      .to(\"aws2-s3://{{api.bucket}}?operation=deleteObject\")\n      .setBody().constant(\"\");\n\n  }\n}\n",
                           "name": "API.java"
                       },
                       {
                           "content": "// camel-k: language=java\npackage test;\n\nimport org.apache.camel.BindToRegistry;\nimport org.apache.camel.PropertyInject;\n\nimport com.amazonaws.auth.AWSCredentials;\nimport com.amazonaws.auth.AWSCredentialsProvider;\nimport com.amazonaws.auth.AWSStaticCredentialsProvider;\nimport com.amazonaws.auth.BasicAWSCredentials;\nimport com.amazonaws.client.builder.AwsClientBuilder;\nimport com.amazonaws.services.s3.AmazonS3;\nimport com.amazonaws.services.s3.AmazonS3ClientBuilder;\n\npublic class MinioCustomizer {\n\n    @BindToRegistry\n    public static AmazonS3 minioClient(\n            @PropertyInject(\"minio.endpoint\") String endpointAddress,\n            @PropertyInject(\"minio.access-key\") String accessKey,\n            @PropertyInject(\"minio.secret-key\") String secretKey) {\n\n        AwsClientBuilder.EndpointConfiguration endpoint = new AwsClientBuilder.EndpointConfiguration(endpointAddress, \"US_EAST_1\");\n        AWSCredentials crede
 ntials = new BasicAWSCredentials(accessKey, secretKey);\n        AWSCredentialsProvider credentialsProvider = new AWSStaticCredentialsProvider(credentials);\n\n        return AmazonS3ClientBuilder\n            .standard()\n            .withEndpointConfiguration(endpoint)\n            .withCredentials(credentialsProvider)\n            .withPathStyleAccessEnabled(true)\n            .build();\n\n    }\n\n}\n",
                           "name": "MinioCustomizer.java"
                       }
                   ],
                   "traits": {
                       "camel": {
                           "properties": [
                               "api.bucket = camel-k",
                               "minio.endpoint = http://minio:9000",
                               "minio.access-key = minio",
                               "minio.secret-key = minio123",
                               "camel.context.rest-configuration.api-context-path = /openapi.json"
                           ]
                       },
                       "openapi": {
                           "configmaps": [
                               "cm-932a65b65ddfcd2cf46ecb13e8e8917190561db3"
                           ]
                       }
                   }
               },
               "status": {
                   "capabilities": [
                       "rest"
                   ],
                   "conditions": [
                       {
                           "firstTruthyTime": "2023-04-17T10:14:55Z",
                           "lastTransitionTime": "2023-04-17T10:14:55Z",
                           "lastUpdateTime": "2023-04-17T10:14:55Z",
                           "message": "camel-api/camel-k",
                           "reason": "IntegrationPlatformAvailable",
                           "status": "True",
                           "type": "IntegrationPlatformAvailable"
                       },
                       {
                           "lastTransitionTime": "2023-04-17T10:15:14Z",
                           "lastUpdateTime": "2023-04-17T10:15:14Z",
                           "message": "error during trait customization: dependency camel:openapi-java not found in Camel catalog",
                           "reason": "InitializationFailed",
                           "status": "False",
                           "type": "Ready"
                       }
                   ],
                   "dependencies": [
                       "mvn:org.apache.camel.quarkus:camel-quarkus-platform-http",
                       "mvn:org.apache.camel.quarkus:camel-quarkus-rest"
                   ],
                   "digest": "vqUf3F7AsVMtGGVM0pRJ9Pbbuq_6XDFTCQBLjubqpXhY",
                   "generatedSources": [
                       {
                           "contentRef": "api-openapi-000",
                           "language": "xml",
                           "name": "openapi.xml"
                       }
                   ],
                   "observedGeneration": 1,
                   "phase": "Error",
                   "platform": "camel-k",
                   "profile": "Knative",
                   "runtimeProvider": "quarkus",
                   "runtimeVersion": "1.17.0"
               }
           }
       ],
       "kind": "List",
       "metadata": {
           "resourceVersion": ""
       }
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] 02-serverless-api example fails [camel-k-examples]

Posted by "bvahdat (via GitHub)" <gi...@apache.org>.
bvahdat commented on issue #77:
URL: https://github.com/apache/camel-k-examples/issues/77#issuecomment-1941060155

   @denisbr please give it another try as I think #94 has now resolved this issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org