babashka / pod-babashka-aws

Deprecated, use https://github.com/grzm/awyeah-api
Apache License 2.0
61 stars 14 forks source link

Add AWS proton support #49

Closed eelkevanfoeken closed 2 years ago

eelkevanfoeken commented 2 years ago

The pod currently does not support AWS proton. Locally, I did manage to fix the issue by updating the dependency in deps.edn, adding the dependency to aws-libs.edn and adding :proton to the list in resources/aws-services.edn, followed by locally compiling the image and running that. If you want I can do a PR?

FYI, the following exception is thrown:


clojure.lang.ExceptionInfo: api :proton not available
{:available #{:mediatailor :medialive :ecr :eks :cloudsearchdomain :budgets :migrationhub-config :monitoring :databrew :kinesis-video-archived-media :elastictranscoder :comprehend :route53domains :pi :ec2 :backup :appconfig :dataexchange :guardduty :worklink :email :codeguru-reviewer :elasticloadbalancing :groundstation :sso :cloudformation :s3control :es :codepipeline :appintegrations :dax :honeycode :mediapackage-vod :cloudtrail :iotfleethub :application-autoscaling :autoscaling-plans :waf :discovery :kinesisanalytics :codestar-notifications :forecastquery :ce :mediaconnect :sagemaker-featurestore-runtime :dms :mobileanalytics :marketplace-catalog :codeartifact :workdocs :elastic-inference :cognito-sync :ecr-public :glacier :marketplacecommerceanalytics :workmailmessageflow :sns :lightsail :autoscaling :iot1click-projects :states :alexaforbusiness :license-manager :machinelearning :storagegateway :glue :config :ssm :personalize :service-quotas :gamelift :lambda :cur :datapipeline :AWS242AppRegistry :sso-admin :shield :codecommit :mediaconvert :braket :logs :inspector :transfer :sesv2 :eventbridge :cloudsearch :elasticmapreduce :support :auditmanager :customer-profiles :events :kinesisvideo :identitystore :kafka :forecast :connect :codestar :ebs :cloudhsmv2 :workmail :wafv2 :rekognition :mediastore-data :amp :sqs :iot :runtime-lex :fms :mq :waf-regional :kinesis-video-signaling :quicksight :ds :acm-pca :ecs :devicefarm :apigatewayv2 :compute-optimizer :swf :entitlement-marketplace :iotsecuretunneling :ram :imagebuilder :network-firewall :organizations :opsworkscm :codeguruprofiler :personalize-runtime :redshift :pinpoint-sms-voice :ec2-instance-connect :batch :signer :wellarchitected :cloud9 :s3outposts :rds :textract :iotevents :savingsplans :resourcegroupstaggingapi :redshift-data :macie2 :streams-dynamodb :lex-models :kinesis-video-media :appflow :securityhub :acm :schemas :docdb :qldb :elasticbeanstalk :timestream-write :secretsmanager :servicecatalog :accessanalyzer :kinesisanalyticsv2 :neptune :sts :athena :iotevents-data :personalize-events :route53 :lakeformation :iotdeviceadvisor :directconnect :serverlessrepo :connect-contact-lens :managedblockchain :dynamodb :elasticfilesystem :cloudhsm :sagemaker-edge :dlm :cloudfront :sms :codestar-connections :translate :health :resource-groups :mediapackage :devices :lookoutvision :opsworks :amplifybackend :frauddetector :route53resolver :cognito-idp :pinpoint-email :mturk-requester :qldb-session :iotthingsgraph :transcribe :iam :comprehendmedical :detective :synthetics :servicediscovery :AWSMigrationHub :greengrassv2 :sdb :rds-data :amplify :clouddirectory :macie :iot-jobs-data :mobile :mediastore :greengrass :codedeploy :pinpoint :connectparticipant :kendra :iot-data :fsx :appmesh :datasync :ivs :workspaces :robomaker :apigatewaymanagementapi :kms :location :chime :apigateway :appstream :pricing :networkmanager :runtime-sagemaker :meteringmarketplace :elasticloadbalancingv2 :s3 :importexport :elasticache :sso-oidc :sagemaker :devops-guru :application-insights :mwaa :emr-containers :appsync :polly :iotsitewise :healthlake :timestream-query :snowball :kinesis :outposts :firehose :cognito-identity :iotwireless :xray :iotanalytics :codebuild :globalaccelerator :sagemaker-a2i-runtime}, :type "class clojure.lang.ExceptionInfo"}
 at babashka.pods.impl$processor.invokeStatic (impl.clj:201)
    babashka.pods.sci$load_pod$fn__30731.invoke (sci.clj:72)
    sci.impl.vars$binding_conveyor_fn$fn__398.invoke (vars.cljc:154)
    clojure.core$binding_conveyor_fn$fn__5788.invoke (core.clj:2035)
    clojure.lang.AFn.call (AFn.java:18)
    java.util.concurrent.FutureTask.run (FutureTask.java:264)
    java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    java.lang.Thread.run (Thread.java:829)
    com.oracle.svm.core.thread.JavaThreads.threadStartRoutine (JavaThreads.java:596)
    com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine (PosixJavaThreads.java:192)
borkdude commented 2 years ago

@eelkevanfoeken We have a script called script/update-deps.clj. I thought this would fetch all the latest stuff, but apparently it's missing something. Could you take a look there and improve the script? After that we can run it and update the pod.

borkdude commented 2 years ago

It seems the deps.edn already contains proton:

$ less deps.edn | grep proton
        com.cognitect.aws/proton                           {:mvn/version "813.2.963.0" :aws/serviceFullName "AWS Proton"}
borkdude commented 2 years ago

I don't think aws-lib.edn is used anywhere.

borkdude commented 2 years ago

There is a list of keys in aws-services.edn but I don't know how that was generated. It should probably be re-generated in script/update-deps.clj but from which data?

(def services (into (sorted-set) (clojure.edn/read-string (slurp (io/resource "aws-services.edn")))))

(def *clients (atom {}))

(defn get-client [config]
  (get @*clients (get config ::client-id)))

(defn -client [{:keys [api] :as config}]
  (if-not (contains? services api)
    (throw (ex-info (str "api " api " not available") {:available services}))
    (let [config (assoc config
                        :http-client @http-client)
          client (aws/client config)
          client-id (java.util.UUID/randomUUID)]
      (swap! *clients assoc client-id client)
      {::client-id client-id})))

This list and above check was put here by @jeroenvandijk so hopefully he can enlighten us :).

jeroenvandijk commented 2 years ago

@borkdude I've created a PR with some explaination https://github.com/babashka/pod-babashka-aws/pull/50

borkdude commented 2 years ago

Thanks a lot! I'll release a new version.

borkdude commented 2 years ago

Released to the pod registry.

eelkevanfoeken commented 2 years ago

Thank you @jeroenvandijk and @borkdude