diff --git a/.github/workflows/2-system.yaml b/.github/workflows/2-system.yaml index a195f55295c..5f547d5533c 100644 --- a/.github/workflows/2-system.yaml +++ b/.github/workflows/2-system.yaml @@ -29,7 +29,7 @@ on: env: # openwhisk env TEST_SUITE: System - ANSIBLE_CMD: "ansible-playbook -i environments/local -e docker_image_prefix=testing -e container_pool_akka_client=false" + ANSIBLE_CMD: "ansible-playbook -i environments/local -e docker_image_prefix=testing -e container_pool_pekko_client=false" GRADLE_PROJS_SKIP: "" ## secrets diff --git a/README.md b/README.md index e31ebb2eed8..a205e475ed9 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,11 @@ Learn more at [http://openwhisk.apache.org](http://openwhisk.apache.org). * [OpenWhisk Community and Support](#openwhisk-community-and-support) * [Project Repository Structure](#project-repository-structure) +### Notice of Breaking Upgrade 10/17/2025 + +Apache Openwhisk has migrated to the Apache Pekko framework. The master branch as of 10/17/2025 uses Apache Pekko. This change results in a breaking change such that you must re-deploy new clusters and cutover traffic to the new cluster. All other changes should be transient to you other than instead of using Akka configuration overrides in your deployments, you would now need to update those to use the Pekko equivalent. A 3.x release branch will eventually follow this +change. + ### Quick Start The easiest way to start using OpenWhisk is to install the "Standalone" OpenWhisk stack. diff --git a/ansible/controller.yml b/ansible/controller.yml index dbd8c02e2cc..1297fa3b8fe 100644 --- a/ansible/controller.yml +++ b/ansible/controller.yml @@ -43,8 +43,8 @@ # configuration settings. (Plugins are found in the # 'roles/controller/tasks' directory for now.) controller_plugins: - # Join an akka cluster rather than running standalone akka - - "join_akka_cluster" + # Join an pekko cluster rather than running standalone pekko + - "join_pekko_cluster" roles: - controller diff --git a/ansible/environments/local/group_vars/all b/ansible/environments/local/group_vars/all index 185c3b33d32..09b0935d934 100644 --- a/ansible/environments/local/group_vars/all +++ b/ansible/environments/local/group_vars/all @@ -45,7 +45,7 @@ kafka_topics_invoker_retentionMS: 300000 env_hosts_dir: "{{ playbook_dir }}/environments/local" -container_pool_akka_client: true +container_pool_pekko_client: true runtimes_enable_concurrency: true limit_action_concurrency_max: 500 namespace_default_limit_action_concurrency_max: 500 diff --git a/ansible/group_vars/all b/ansible/group_vars/all index c2c04476d62..301ce385692 100644 --- a/ansible/group_vars/all +++ b/ansible/group_vars/all @@ -99,7 +99,7 @@ controller: timeoutFactor: "{{ controller_timeout_factor | default(2) }}" timeoutAddon: "{{ controller_timeout_addon | default('1 m') }}" instances: "{{ groups['controllers'] | length }}" - akka: + pekko: provider: cluster cluster: basePort: 8000 @@ -517,10 +517,10 @@ scheduler: instances: "{{ groups['schedulers'] | length }}" username: "{{ scheduler_username | default('scheduler.user') }}" password: "{{ scheduler_password | default('scheduler.pass') }}" - akka: + pekko: provider: cluster cluster: - basePort: 25520 + basePort: 17355 host: "{{ groups['schedulers'] | map('extract', hostvars, 'ansible_host') | list }}" bindPort: 3551 # at this moment all schedulers are seed nodes diff --git a/ansible/roles/controller/tasks/deploy.yml b/ansible/roles/controller/tasks/deploy.yml index 0b604bc45dd..d868027ac76 100644 --- a/ansible/roles/controller/tasks/deploy.yml +++ b/ansible/roles/controller/tasks/deploy.yml @@ -443,18 +443,42 @@ >> /logs/{{ controller_name }}_logs.log 2>&1" - name: wait until the Controller in this host is up and running - uri: - url: - "{{controller.protocol}}://{{ansible_host}}:{{controller_port}}/ping" - validate_certs: "no" - client_key: - "{{ controller.confdir }}/{{ controller_name }}/{{ controller.ssl.key }}" - client_cert: - "{{ controller.confdir }}/{{ controller_name }}/{{ controller.ssl.cert }}" - register: result - until: result.status == 200 - retries: 12 - delay: 10 + block: + - name: ping controller health endpoint + uri: + url: "{{ controller.protocol }}://{{ ansible_host }}:{{ controller_port }}/ping" + validate_certs: no + client_key: "{{ controller.confdir }}/{{ controller_name }}/{{ controller.ssl.key }}" + client_cert: "{{ controller.confdir }}/{{ controller_name }}/{{ controller.ssl.cert }}" + return_content: yes + user: "{{ controller.username }}" + password: "{{ controller.password }}" + force_basic_auth: yes + register: result + until: result.status == 200 + retries: 12 + delay: 10 + failed_when: result.status is defined and result.status not in [200] + rescue: + - name: dump controller docker logs + shell: | + docker logs {{ controller_name }} >/tmp/controller-docker.log 2>&1 || true + cat /tmp/controller-docker.log + register: controller_logs + failed_when: false + - name: output controller logs for debugging + debug: + var: controller_logs.stdout_lines + - name: dump controller file logs + shell: | + cat /var/tmp/wsklogs/{{ controller_name }}/{{ controller_name }}_logs.log + register: controller_file_logs + failed_when: false + - name: output controller file logs for debugging + debug: + var: controller_file_logs.stdout_lines + - fail: + msg: "Controller failed to start; logs emitted above" - name: warm up activation path uri: diff --git a/ansible/roles/controller/tasks/join_akka_cluster.yml b/ansible/roles/controller/tasks/join_pekko_cluster.yml similarity index 50% rename from ansible/roles/controller/tasks/join_akka_cluster.yml rename to ansible/roles/controller/tasks/join_pekko_cluster.yml index dc0a1eeb4f4..6c986251614 100644 --- a/ansible/roles/controller/tasks/join_akka_cluster.yml +++ b/ansible/roles/controller/tasks/join_pekko_cluster.yml @@ -17,36 +17,37 @@ --- # # Controller 'plugin' that will add the items necessary to the controller -# environment to cause the controller to join a specified akka cluster +# environment to cause the controller to join a specified pekko cluster # -- name: add akka port to ports_to_expose +- name: add pekko port to ports_to_expose set_fact: ports_to_expose: >- {{ ports_to_expose }} + - [ "{{ (controller.akka.cluster.basePort + (controller_index | int)) }}:" - + "{{ controller.akka.cluster.bindPort }}" ] + [ "{{ (controller.pekko.cluster.basePort + (controller_index | int)) }}:" + + "{{ controller.pekko.cluster.bindPort }}" ] - name: add seed nodes to controller environment set_fact: env: >- {{ env | combine({ - 'CONFIG_akka_cluster_seedNodes_' ~ seedNode.0: - 'akka://controller-actor-system@'~seedNode.1~':'~(controller.akka.cluster.basePort+seedNode.0) + 'CONFIG_pekko_cluster_seedNodes_' ~ seedNode.0: + 'pekko://controller-actor-system@'~seedNode.1~':'~(controller.pekko.cluster.basePort+seedNode.0) }) }} - with_indexed_items: "{{ controller.akka.cluster.seedNodes }}" + with_indexed_items: "{{ controller.pekko.cluster.seedNodes }}" loop_control: loop_var: seedNode -- name: Add akka environment to controller environment +- name: Add pekko environment to controller environment vars: - akka_env: - "CONFIG_akka_actor_provider": "{{ controller.akka.provider }}" - "CONFIG_akka_remote_artery_canonical_hostname": - "{{ controller.akka.cluster.host[(controller_index | int)] }}" - "CONFIG_akka_remote_artery_canonical_port": - "{{ controller.akka.cluster.basePort + (controller_index | int) }}" - "CONFIG_akka_remote_artery_bind_port": - "{{ controller.akka.cluster.bindPort }}" + pekko_env: + "CONFIG_pekko_actor_provider": "{{ controller.pekko.provider }}" + "CONFIG_pekko_remote_artery_canonical_hostname": + "{{ controller.pekko.cluster.host[(controller_index | int)] }}" + "CONFIG_pekko_remote_artery_canonical_port": + "{{ controller.pekko.cluster.basePort + (controller_index | int) }}" + "CONFIG_pekko_remote_artery_bind_hostname": "0.0.0.0" + "CONFIG_pekko_remote_artery_bind_port": + "{{ controller.pekko.cluster.bindPort }}" set_fact: - env: "{{ env | combine(akka_env) }}" + env: "{{ env | combine(pekko_env) }}" diff --git a/ansible/roles/invoker/tasks/deploy.yml b/ansible/roles/invoker/tasks/deploy.yml index b89bd1da1f8..fa3f6f5838b 100644 --- a/ansible/roles/invoker/tasks/deploy.yml +++ b/ansible/roles/invoker/tasks/deploy.yml @@ -288,7 +288,7 @@ "CONFIG_whisk_namespaceDefaultLimit_concurrencyLimit_max": "{{ namespace_default_limit_action_concurrency_max | default() }}" "CONFIG_whisk_activation_payload_max": "{{ limit_activation_payload | default() }}" "CONFIG_whisk_transactions_header": "{{ transactions.header }}" - "CONFIG_whisk_containerPool_akkaClient": "{{ container_pool_akka_client | default('false') | lower }}" + "CONFIG_whisk_containerPool_pekkoClient": "{{ container_pool_pekko_client | default('false') | lower }}" "CONFIG_whisk_containerFactory_containerArgs_extraEnvVars_0": "__OW_ALLOW_CONCURRENT={{ runtimes_enable_concurrency | default('false') }}" "CONFIG_whisk_invoker_protocol": "{{ invoker.protocol }}" "CONFIG_whisk_invoker_https_keystorePath": "/conf/{{ invoker.ssl.keystore.name }}" @@ -447,13 +447,31 @@ when: not lean - name: wait until Invoker is up and running - uri: - url: "{{ invoker.protocol }}://{{ ansible_host }}:{{ invoker.port + (invoker_index | int) }}/ping" - validate_certs: "no" - client_key: "{{ invoker.confdir }}/{{ invoker_name }}/{{ invoker.ssl.key }}" - client_cert: "{{ invoker.confdir }}/{{ invoker_name }}/{{ invoker.ssl.cert }}" - register: result - until: result.status == 200 - retries: 12 - delay: 5 + block: + - uri: + url: "{{ invoker.protocol }}://{{ ansible_host }}:{{ invoker.port + (invoker_index | int) }}/ping" + validate_certs: "no" + client_key: "{{ invoker.confdir }}/{{ invoker_name }}/{{ invoker.ssl.key }}" + client_cert: "{{ invoker.confdir }}/{{ invoker_name }}/{{ invoker.ssl.cert }}" + register: result + until: result.status == 200 + retries: 12 + delay: 5 + rescue: + - name: dump invoker docker logs for debugging + shell: "docker logs {{ invoker_name }}" + register: invoker_logs + failed_when: false + - name: output invoker docker logs for debugging + debug: + var: invoker_logs.stdout_lines + - name: dump invoker file logs from /var/tmp/wsklogs + shell: "cat /var/tmp/wsklogs/{{ invoker_name }}/{{ invoker_name }}_logs.log" + register: invoker_file_logs + failed_when: false + - name: output invoker file logs for debugging + debug: + var: invoker_file_logs.stdout_lines + - fail: + msg: "Invoker failed to start; logs emitted above" when: not lean diff --git a/ansible/roles/schedulers/tasks/deploy.yml b/ansible/roles/schedulers/tasks/deploy.yml index 46b5aaca8b7..b083adb18ab 100644 --- a/ansible/roles/schedulers/tasks/deploy.yml +++ b/ansible/roles/schedulers/tasks/deploy.yml @@ -122,7 +122,7 @@ "WHISK_SCHEDULER_ENDPOINTS_HOST": "{{ ansible_host }}" "WHISK_SCHEDULER_ENDPOINTS_RPCPORT": "{{ scheduler.grpc.basePort + (scheduler_index | int)}}" - "WHISK_SCHEDULER_ENDPOINTS_AKKAPORT": "{{ scheduler.akka.cluster.basePort + (scheduler_index | int) }}" + "WHISK_SCHEDULER_ENDPOINTS_PEKKOPORT": "{{ scheduler.pekko.cluster.basePort + (scheduler_index | int) }}" "CONFIG_whisk_scheduler_protocol": "{{ scheduler.protocol }}" "CONFIG_whisk_scheduler_maxPeek": "{{ scheduler.maxPeek }}" "CONFIG_whisk_scheduler_dataManagementService_retryInterval": "{{ scheduler.dataManagementService.retryInterval }}" @@ -348,14 +348,36 @@ >> /logs/{{ scheduler_name }}_logs.log 2>&1" - name: wait until the Scheduler in this host is up and running - uri: - url: - "{{scheduler.protocol}}://{{ansible_host}}:{{scheduler_port}}/ping" - validate_certs: "no" - register: result - until: result.status == 200 - retries: 12 - delay: 5 + block: + - name: ping scheduler health endpoint + uri: + url: + "{{scheduler.protocol}}://{{ansible_host}}:{{scheduler_port}}/ping" + validate_certs: "no" + register: result + until: result.status == 200 + retries: 12 + delay: 5 + rescue: + - name: dump scheduler docker logs + shell: | + docker logs {{ scheduler_name }} >/tmp/scheduler-docker.log 2>&1 || true + cat /tmp/scheduler-docker.log + register: scheduler_logs + failed_when: false + - name: output scheduler logs for debugging + debug: + var: scheduler_logs.stdout_lines + - name: dump scheduler file logs + shell: | + cat /var/tmp/wsklogs/{{ scheduler_name }}/{{ scheduler_name }}_logs.log + register: scheduler_file_logs + failed_when: false + - name: output scheduler file logs for debugging + debug: + var: scheduler_file_logs.stdout_lines + - fail: + msg: "Scheduler failed to start; logs emitted above" - name: create scheduler jmx.yml template: diff --git a/ansible/roles/schedulers/tasks/join_akka_cluster.yml b/ansible/roles/schedulers/tasks/join_pekko_cluster.yml similarity index 51% rename from ansible/roles/schedulers/tasks/join_akka_cluster.yml rename to ansible/roles/schedulers/tasks/join_pekko_cluster.yml index 662a8707762..ee0c39930f4 100644 --- a/ansible/roles/schedulers/tasks/join_akka_cluster.yml +++ b/ansible/roles/schedulers/tasks/join_pekko_cluster.yml @@ -17,36 +17,37 @@ --- # # Scheduler 'plugin' that will add the items necessary to the scheduler -# environment to cause the scheduler to join a specified akka cluster +# environment to cause the scheduler to join a specified pekko cluster # -- name: add akka port to ports_to_expose +- name: add pekko port to ports_to_expose set_fact: ports_to_expose: >- {{ ports_to_expose }} + - [ "{{ (scheduler.akka.cluster.basePort + (scheduler_index | int)) }}:" - + "{{ scheduler.akka.cluster.bindPort }}" ] + [ "{{ (scheduler.pekko.cluster.basePort + (scheduler_index | int)) }}:" + + "{{ scheduler.pekko.cluster.bindPort }}" ] - name: add seed nodes to scheduler environment set_fact: env: >- {{ env | combine({ - 'CONFIG_akka_cluster_seedNodes_' ~ seedNode.0: - 'akka://scheduler-actor-system@'~seedNode.1~':'~(scheduler.akka.cluster.basePort+seedNode.0) + 'CONFIG_pekko_cluster_seedNodes_' ~ seedNode.0: + 'pekko://scheduler-actor-system@'~seedNode.1~':'~(scheduler.pekko.cluster.basePort+seedNode.0) }) }} - with_indexed_items: "{{ scheduler.akka.cluster.seedNodes }}" + with_indexed_items: "{{ scheduler.pekko.cluster.seedNodes }}" loop_control: loop_var: seedNode -- name: Add akka environment to scheduler environment +- name: Add pekko environment to scheduler environment vars: - akka_env: - "CONFIG_akka_actor_provider": "{{ scheduler.akka.provider }}" - "CONFIG_akka_remote_artery_canonical_hostname": - "{{ scheduler.akka.cluster.host[(scheduler_index | int)] }}" - "CONFIG_akka_remote_artery_canonical_port": - "{{ scheduler.akka.cluster.basePort + (scheduler_index | int) }}" - "CONFIG_akka_remote_artery_bind_port": - "{{ scheduler.akka.cluster.bindPort }}" + pekko_env: + "CONFIG_pekko_actor_provider": "{{ scheduler.pekko.provider }}" + "CONFIG_pekko_remote_artery_canonical_hostname": + "{{ scheduler.pekko.cluster.host[(scheduler_index | int)] }}" + "CONFIG_pekko_remote_artery_canonical_port": + "{{ scheduler.pekko.cluster.basePort + (scheduler_index | int) }}" + "CONFIG_pekko_remote_artery_bind_hostname": "0.0.0.0" + "CONFIG_pekko_remote_artery_bind_port": + "{{ scheduler.pekko.cluster.bindPort }}" set_fact: - env: "{{ env | combine(akka_env) }}" + env: "{{ env | combine(pekko_env) }}" diff --git a/ansible/scheduler.yml b/ansible/scheduler.yml index 2c6a7a23ed2..7828c7eb500 100644 --- a/ansible/scheduler.yml +++ b/ansible/scheduler.yml @@ -43,8 +43,8 @@ # configuration settings. (Plugins are found in the # 'roles/controller/tasks' directory for now.) scheduler_plugins: - # Join an akka cluster rather than running standalone akka - - "join_akka_cluster" + # Join an pekko cluster rather than running standalone pekko + - "join_pekko_cluster" serial: '1' roles: diff --git a/build.gradle b/build.gradle index 9987d433c4c..0a44281cbeb 100644 --- a/build.gradle +++ b/build.gradle @@ -38,26 +38,27 @@ subprojects { version '1.0.1-SNAPSHOT' pluginManager.withPlugin('scala') { - // Constraint all transitive akka-* dependencies to the one we want to use to avoid issues. - // List generated via - // ./gradlew :test:dependencies | grep -o 'akka-.*_' | cut -c 6- | rev | cut -c 2- | rev | sort -u + // Constraint all transitive pekko-* dependencies to the one we want to use to avoid issues. def cons = project.getDependencies().getConstraints() - def akka = ['akka-actor', 'akka-cluster', 'akka-cluster-metrics', 'akka-cluster-tools', 'akka-coordination', - 'akka-discovery', 'discovery-kubernetes-api', 'discovery-marathon-api', 'akka-distributed-data','grpc-runtime','akka-protobuf', 'akka-remote', 'akka-slf4j', - 'akka-stream', 'akka-stream-testkit', 'akka-testkit', 'akka-persistence', 'akka-cluster-sharding','akka-protobuf-v3','akka-pki','akka-parsing','akka-management-cluster-bootstrap','akka-management', - 'akka-kryo-serialization'] - def akkaHttp = ['akka-http', 'akka-http-core', 'akka-http-spray-json', 'akka-http-testkit', 'akka-http-xml', - 'akka-parsing', 'akka-http2-support'] - def akkaKafka = ['akka-stream-kafka-testkit','akka-stream-kafka','akka-stream-alpakka-s3','akka-stream-alpakka-file'] - - akka.forEach { - cons.add('implementation', "com.typesafe.akka:${it}_${gradle.scala.depVersion}:${gradle.akka.version}") + def pekko = ['pekko-actor', 'pekko-actor-typed', 'pekko-cluster', 'pekko-cluster-metrics', 'pekko-cluster-tools', 'pekko-coordination', + 'pekko-discovery', 'discovery-kubernetes-api', 'discovery-marathon-api', 'pekko-distributed-data','grpc-runtime','pekko-protobuf', 'pekko-remote', 'pekko-slf4j', + 'pekko-stream', 'pekko-stream-testkit', 'pekko-testkit', 'pekko-persistence', 'pekko-cluster-sharding','pekko-protobuf-v3','pekko-pki','pekko-serialization-jackson'] + def pekkoHttp = ['pekko-http', 'pekko-http-core', 'pekko-http-spray-json', 'pekko-http-testkit', 'pekko-http-xml', + 'pekko-http2-support'] + def pekkoKafka = ['pekko-stream-kafka-testkit','pekko-connectors-kafka','pekko-connectors-s3','pekko-connectors-file'] + def pekkoManagement = ['pekko-management-cluster-bootstrap','pekko-management','pekko-discovery-kubernetes-api','pekko-discovery-marathon-api'] + + pekko.forEach { + cons.add('implementation', "org.apache.pekko:${it}_${gradle.scala.depVersion}:${gradle.pekko.version}") } - akkaHttp.forEach { - cons.add('implementation', "com.typesafe.akka:${it}_${gradle.scala.depVersion}:${gradle.akka_http.version}") + pekkoHttp.forEach { + cons.add('implementation', "org.apache.pekko:${it}_${gradle.scala.depVersion}:${gradle.pekko_http.version}") } - akkaKafka.forEach{ - cons.add('implementation', "com.typesafe.akka:${it}_${gradle.scala.depVersion}:${gradle.akka_kafka.version}") + pekkoKafka.forEach{ + cons.add('implementation', "org.apache.pekko:${it}_${gradle.scala.depVersion}:${gradle.pekko_kafka.version}") + } + pekkoManagement.forEach{ + cons.add('implementation', "org.apache.pekko:${it}_${gradle.scala.depVersion}:${gradle.pekko_management.version}") } } diff --git a/common/scala/build.gradle b/common/scala/build.gradle index bb0bca5466d..7e9849b06e0 100644 --- a/common/scala/build.gradle +++ b/common/scala/build.gradle @@ -48,26 +48,29 @@ dependencies { } api "io.spray:spray-json_${gradle.scala.depVersion}:1.3.5" api "com.lihaoyi:fastparse_${gradle.scala.depVersion}:2.3.0" - api "com.typesafe.akka:akka-actor_${gradle.scala.depVersion}:${gradle.akka.version}" - api "com.typesafe.akka:akka-stream_${gradle.scala.depVersion}:${gradle.akka.version}" - api "com.typesafe.akka:akka-slf4j_${gradle.scala.depVersion}:${gradle.akka.version}" - api "com.typesafe.akka:akka-cluster_${gradle.scala.depVersion}:${gradle.akka.version}" - api "com.typesafe.akka:akka-cluster-metrics_${gradle.scala.depVersion}:${gradle.akka.version}" - api "com.typesafe.akka:akka-cluster-tools_${gradle.scala.depVersion}:${gradle.akka.version}" - api "com.typesafe.akka:akka-distributed-data_${gradle.scala.depVersion}:${gradle.akka.version}" - - api "com.typesafe.akka:akka-http-core_${gradle.scala.depVersion}:${gradle.akka_http.version}" - api "com.typesafe.akka:akka-http-spray-json_${gradle.scala.depVersion}:${gradle.akka_http.version}" - - api "com.lightbend.akka:akka-stream-alpakka-file_${gradle.scala.depVersion}:2.0.2" - - api "ch.qos.logback:logback-classic:1.2.13" - api "org.slf4j:jcl-over-slf4j:1.7.25" - api "org.slf4j:log4j-over-slf4j:1.7.25" + api "org.apache.pekko:pekko-actor_${gradle.scala.depVersion}:${gradle.pekko.version}" + api "org.apache.pekko:pekko-actor-typed_${gradle.scala.depVersion}:${gradle.pekko.version}" + api "org.apache.pekko:pekko-cluster-typed_${gradle.scala.depVersion}:${gradle.pekko.version}" + api "org.apache.pekko:pekko-stream_${gradle.scala.depVersion}:${gradle.pekko.version}" + api "org.apache.pekko:pekko-slf4j_${gradle.scala.depVersion}:${gradle.pekko.version}" + api "org.apache.pekko:pekko-cluster_${gradle.scala.depVersion}:${gradle.pekko.version}" + api "org.apache.pekko:pekko-cluster-metrics_${gradle.scala.depVersion}:${gradle.pekko.version}" + api "org.apache.pekko:pekko-cluster-tools_${gradle.scala.depVersion}:${gradle.pekko.version}" + api "org.apache.pekko:pekko-distributed-data_${gradle.scala.depVersion}:${gradle.pekko.version}" + + api "org.apache.pekko:pekko-http-core_${gradle.scala.depVersion}:${gradle.pekko_http.version}" + api "org.apache.pekko:pekko-http-spray-json_${gradle.scala.depVersion}:${gradle.pekko_http.version}" + + api "org.apache.pekko:pekko-connectors-file_${gradle.scala.depVersion}:${gradle.pekko_kafka.version}" + + api "ch.qos.logback:logback-classic:1.3.15" + api "org.slf4j:slf4j-api:2.0.9" + api "org.slf4j:jcl-over-slf4j:2.0.17" + api "org.slf4j:log4j-over-slf4j:2.0.17" api "commons-codec:commons-codec:1.9" api "commons-io:commons-io:2.14.0" api "commons-collections:commons-collections:3.2.2" - api "org.apache.kafka:kafka-clients:2.8.2" + api "org.apache.kafka:kafka-clients:3.9.1" api "org.apache.httpcomponents:httpclient:4.5.5" api "com.fasterxml.uuid:java-uuid-generator:3.1.3" api "com.github.ben-manes.caffeine:caffeine:2.6.2" @@ -85,7 +88,7 @@ dependencies { api "io.kamon:kamon-prometheus_${gradle.scala.depVersion}:2.1.12" api "io.kamon:kamon-datadog_${gradle.scala.depVersion}:2.1.12" - // for etcd + // for etcd - aligned with Pekko gRPC api "com.ibm.etcd:etcd-java:0.0.24" //tracing support @@ -101,14 +104,14 @@ dependencies { api "io.reactivex:rxjava-reactive-streams:1.2.1" - api ("com.lightbend.akka:akka-stream-alpakka-s3_${gradle.scala.depVersion}:1.1.2") { - exclude group: 'org.apache.httpcomponents' //Not used as alpakka uses akka-http + api ("org.apache.pekko:pekko-connectors-s3_${gradle.scala.depVersion}:${gradle.pekko_kafka.version}") { + exclude group: 'org.apache.httpcomponents' //Not used as pekko-connectors uses pekko-http exclude group: 'com.fasterxml.jackson.core' exclude group: 'com.fasterxml.jackson.dataformat' } api "com.amazonaws:aws-java-sdk-cloudfront:1.12.792" // Upgraded to remove ion-java dependency (CVE-2024-21634) - api ("com.azure:azure-storage-blob:12.7.0") { + api ("com.azure:azure-storage-blob:12.18.0") { exclude group: "com.azure", module: "azure-core-test" } @@ -144,56 +147,49 @@ dependencies { api "io.netty:netty-codec-http2:${gradle.netty.version}" api "io.netty:netty-transport-native-epoll:${gradle.netty.version}" api "io.netty:netty-transport-native-unix-common:${gradle.netty.version}" - api "com.lightbend.akka.grpc:akka-grpc-runtime_${gradle.scala.depVersion}:${gradle.akka_gprc.version}" + + api "org.apache.pekko:pekko-grpc-runtime_${gradle.scala.depVersion}:${gradle.pekko_grpc.version}" + api "org.apache.pekko:pekko-stream_${gradle.scala.depVersion}:${gradle.pekko.version}" + + // Constraints for transitive dependencies to address security vulnerabilities constraints { - api("com.lightbend.akka.grpc:akka-grpc-runtime_${gradle.scala.depVersion}:${gradle.akka_gprc.version}") + api("com.squareup.okhttp3:okhttp:4.9.2") + api("com.squareup.okhttp3:mockwebserver:4.9.2") + api("com.squareup.okio:okio:3.9.1") + + api("org.apache.commons:commons-lang3:3.18.0") + + api("io.projectreactor.netty:reactor-netty-core:1.2.8") + api("io.projectreactor.netty:reactor-netty-http:1.2.8") + api("io.grpc:grpc-api:${gradle.grpc.version}") { - version { - strictly gradle.grpc.version - } - because "Akka gRPC runtime 1.0.2 requires gRPC 1.32.1" + version { strictly gradle.grpc.version } + because "Align all gRPC artifacts with Pekko gRPC runtime ${gradle.pekko_grpc.version}" } api("io.grpc:grpc-core:${gradle.grpc.version}") { - version { - strictly gradle.grpc.version - } - because "Akka gRPC runtime 1.0.2 requires gRPC 1.32.1" + version { strictly gradle.grpc.version } + because "Align all gRPC artifacts with Pekko gRPC runtime ${gradle.pekko_grpc.version}" } api("io.grpc:grpc-netty:${gradle.grpc.version}") { - version { - strictly gradle.grpc.version - } - because "Akka gRPC runtime 1.0.2 requires gRPC 1.32.1" + version { strictly gradle.grpc.version } + because "Align all gRPC artifacts with Pekko gRPC runtime ${gradle.pekko_grpc.version}" } api("io.grpc:grpc-netty-shaded:${gradle.grpc.version}") { - version { - strictly gradle.grpc.version - } - because "Akka gRPC runtime 1.0.2 requires gRPC 1.32.1" - } - api("io.grpc:grpc-stub:${gradle.grpc.version}") { - version { - strictly gradle.grpc.version - } - because "Akka gRPC runtime 1.0.2 requires gRPC 1.32.1" + version { strictly gradle.grpc.version } + because "Align all gRPC artifacts with Pekko gRPC runtime ${gradle.pekko_grpc.version}" } api("io.grpc:grpc-protobuf:${gradle.grpc.version}") { - version { - strictly gradle.grpc.version - } - because "Akka gRPC runtime 1.0.2 requires gRPC 1.32.1" + version { strictly gradle.grpc.version } + because "Align all gRPC artifacts with Pekko gRPC runtime ${gradle.pekko_grpc.version}" } api("io.grpc:grpc-protobuf-lite:${gradle.grpc.version}") { - version { - strictly gradle.grpc.version - } - because "Akka gRPC runtime 1.0.2 requires gRPC 1.32.1" + version { strictly gradle.grpc.version } + because "Align all gRPC artifacts with Pekko gRPC runtime ${gradle.pekko_grpc.version}" + } + api("io.grpc:grpc-stub:${gradle.grpc.version}") { + version { strictly gradle.grpc.version } + because "Align all gRPC artifacts with Pekko gRPC runtime ${gradle.pekko_grpc.version}" } - } - api "com.typesafe.akka:akka-stream_${gradle.scala.depVersion}:${gradle.akka.version}" - - // Constraints for transitive dependencies to address security vulnerabilities - constraints { api("org.apache.commons:commons-text:1.10.0") api("com.google.code.gson:gson:2.8.9") diff --git a/common/scala/src/main/resources/application.conf b/common/scala/src/main/resources/application.conf index 5c98c4ddc01..81682b1c423 100644 --- a/common/scala/src/main/resources/application.conf +++ b/common/scala/src/main/resources/application.conf @@ -15,14 +15,14 @@ # limitations under the License. # -# default application configuration file for akka +# default application configuration file for pekko include "logging" -akka { +pekko { java-flight-recorder.enabled = false } -akka.http { +pekko.http { client { parsing.illegal-header-warnings = off parsing.max-chunk-size = 50m @@ -56,7 +56,7 @@ kamon { datadog-trace-agent { enabled = false } - # This should never be set to true as we register Prometheus reporters manually and surface them via akka-http. + # This should never be set to true as we register Prometheus reporters manually and surface them via pekko-http. prometheus-reporter { enabled = false } @@ -94,7 +94,7 @@ kamon { metric-key-generator = org.apache.openwhisk.common.WhiskStatsDMetricKeyGenerator } prometheus { - # We expose the metrics endpoint over akka http. So default server is disabled + # We expose the metrics endpoint over pekko http. So default server is disabled start-embedded-http-server = no buckets { diff --git a/common/scala/src/main/resources/logging.conf b/common/scala/src/main/resources/logging.conf index 258d2f18a75..79770a1e1b6 100644 --- a/common/scala/src/main/resources/logging.conf +++ b/common/scala/src/main/resources/logging.conf @@ -15,8 +15,8 @@ # limitations under the License. # -akka { +pekko { loglevel = "DEBUG" - loggers = ["akka.event.slf4j.Slf4jLogger"] - logging-filter = "akka.event.slf4j.Slf4jLoggingFilter" + loggers = ["org.apache.pekko.event.slf4j.Slf4jLogger"] + logging-filter = "org.apache.pekko.event.slf4j.Slf4jLoggingFilter" } diff --git a/common/scala/src/main/resources/s3-reference.conf b/common/scala/src/main/resources/s3-reference.conf index 45ea0ba1fb4..a27659d5a41 100644 --- a/common/scala/src/main/resources/s3-reference.conf +++ b/common/scala/src/main/resources/s3-reference.conf @@ -40,8 +40,8 @@ whisk { # timeout = 10 min # } - # See https://github.com/akka/alpakka/blob/v1.0.0/s3/src/main/resources/reference.conf - alpakka { + # See https://pekko.apache.org/docs/pekko-connectors/current/s3.html + pekko-connectors { # whether the buffer request chunks (up to 5MB each) to "memory" or "disk" buffer = "memory" @@ -110,6 +110,29 @@ whisk { # Which version of the list bucket api to use. Set to 1 to use the old style version 1 API. # By default the newer version 2 api is used. list-bucket-api-version = 2 + + # Validate the object key before making requests to S3 + validate-object-key = true + + # Whether to sign anonymous requests + sign-anonymous-requests = true + + # Default settings corresponding to automatic retry of requests in an S3 stream. + retry-settings { + # The maximum number of additional attempts (following transient errors) that will be made to process a given request before giving up. + max-retries = 3 + # The minimum delay between request retries. + min-backoff = 200ms + # The maximum delay between request retries. + max-backoff = 10s + # Random jitter factor applied to retry delay calculation. + random-factor = 0.0 + } + + # Various settings for the multipart upload + multipart-upload { + retry-settings = ${whisk.s3.pekko-connectors.retry-settings} + } } } } diff --git a/common/scala/src/main/scala/org/apache/openwhisk/common/ExecutorCloser.scala b/common/scala/src/main/scala/org/apache/openwhisk/common/ExecutorCloser.scala index 134cf7a411a..51d868a58f5 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/common/ExecutorCloser.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/common/ExecutorCloser.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.common import java.io.Closeable import java.util.concurrent.{ExecutorService, TimeUnit} -import akka.event.slf4j.SLF4JLogging +import org.apache.pekko.event.slf4j.SLF4JLogging import scala.concurrent.duration._ diff --git a/common/scala/src/main/scala/org/apache/openwhisk/common/Https.scala b/common/scala/src/main/scala/org/apache/openwhisk/common/Https.scala index b60b86c938a..7c45e5dfa65 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/common/Https.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/common/Https.scala @@ -20,8 +20,8 @@ package org.apache.openwhisk.common import java.io.{FileInputStream, InputStream} import java.security.{KeyStore, SecureRandom} import javax.net.ssl.{KeyManagerFactory, SSLContext, TrustManagerFactory} -import akka.http.scaladsl.{ConnectionContext, HttpsConnectionContext} -import akka.stream.TLSClientAuth +import org.apache.pekko.http.scaladsl.{ConnectionContext, HttpsConnectionContext} +import org.apache.pekko.stream.TLSClientAuth object Https { case class HttpsConfig(keystorePassword: String, keystoreFlavor: String, keystorePath: String, clientAuth: String) @@ -62,7 +62,7 @@ object Https { // Currently, we are using the keystore as truststore as well, because the clients use the same keys as the // server for client authentication (if enabled). - // So this code is guided by https://doc.akka.io/docs/akka-http/10.0.9/scala/http/server-side-https-support.html + // So this code is guided by https://pekko.apache.org/docs/pekko-http/current/server-side/server-https-support.html // This needs to be reworked, when we fix the keys and certificates. val trustManagerFactory: TrustManagerFactory = TrustManagerFactory.getInstance(keyFactoryType) trustManagerFactory.init(keyStore) diff --git a/common/scala/src/main/scala/org/apache/openwhisk/common/Logging.scala b/common/scala/src/main/scala/org/apache/openwhisk/common/Logging.scala index c2c4bbf5958..b79a91b816b 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/common/Logging.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/common/Logging.scala @@ -20,8 +20,8 @@ package org.apache.openwhisk.common import java.io.PrintStream import java.time.{Clock, Instant, ZoneId} import java.time.format.DateTimeFormatter -import akka.event.Logging._ -import akka.event.LoggingAdapter +import org.apache.pekko.event.Logging._ +import org.apache.pekko.event.LoggingAdapter import kamon.Kamon import kamon.metric.{MeasurementUnit, Counter => KCounter, Gauge => KGauge, Histogram => KHistogram} import kamon.statsd.{MetricKeyGenerator, SimpleMetricKeyGenerator} @@ -86,9 +86,9 @@ trait Logging { } /** - * Implementation of Logging, that uses Akka logging. + * Implementation of Logging, that uses Pekko logging. */ -class AkkaLogging(loggingAdapter: LoggingAdapter) extends Logging { +class PekkoLogging(loggingAdapter: LoggingAdapter) extends Logging { def emit(loglevel: LogLevel, id: TransactionId, from: AnyRef, message: => String) = { if (loggingAdapter.isEnabled(loglevel)) { val logmsg: String = message // generates the message diff --git a/common/scala/src/main/scala/org/apache/openwhisk/common/Prometheus.scala b/common/scala/src/main/scala/org/apache/openwhisk/common/Prometheus.scala index 87dc46f6d5e..9a4fdd942d7 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/common/Prometheus.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/common/Prometheus.scala @@ -18,9 +18,9 @@ package org.apache.openwhisk.common import java.nio.charset.StandardCharsets.UTF_8 -import akka.http.scaladsl.model.{ContentType, HttpCharsets, HttpEntity, MediaType} -import akka.http.scaladsl.server.Directives._ -import akka.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.model.{ContentType, HttpCharsets, HttpEntity, MediaType} +import org.apache.pekko.http.scaladsl.server.Directives._ +import org.apache.pekko.http.scaladsl.server.Route import kamon.Kamon import kamon.prometheus.PrometheusReporter diff --git a/common/scala/src/main/scala/org/apache/openwhisk/common/Scheduler.scala b/common/scala/src/main/scala/org/apache/openwhisk/common/Scheduler.scala index 48e6a07847b..2324ecabf2a 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/common/Scheduler.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/common/Scheduler.scala @@ -23,10 +23,10 @@ import scala.util.Failure import scala.util.Success import scala.util.Try -import akka.actor.Actor -import akka.actor.ActorSystem -import akka.actor.Cancellable -import akka.actor.Props +import org.apache.pekko.actor.Actor +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.actor.Cancellable +import org.apache.pekko.actor.Props /** * Scheduler utility functions to execute tasks in a repetitive way with controllable behavior diff --git a/common/scala/src/main/scala/org/apache/openwhisk/common/TransactionId.scala b/common/scala/src/main/scala/org/apache/openwhisk/common/TransactionId.scala index de9c8c056f0..d71a1ac8cf3 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/common/TransactionId.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/common/TransactionId.scala @@ -19,8 +19,8 @@ package org.apache.openwhisk.common import java.time.{Clock, Duration, Instant} -import akka.event.Logging.{DebugLevel, InfoLevel, LogLevel, WarningLevel} -import akka.http.scaladsl.model.headers.RawHeader +import org.apache.pekko.event.Logging.{DebugLevel, InfoLevel, LogLevel, WarningLevel} +import org.apache.pekko.http.scaladsl.model.headers.RawHeader import spray.json._ import org.apache.openwhisk.core.ConfigKeys import pureconfig._ diff --git a/common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KafkaConsumerConnector.scala b/common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KafkaConsumerConnector.scala index 1f9bc2ace13..edfa42aac25 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KafkaConsumerConnector.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KafkaConsumerConnector.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.connector.kafka -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import org.apache.kafka.clients.consumer.{ConsumerConfig, KafkaConsumer} import org.apache.kafka.common.TopicPartition import org.apache.kafka.common.errors.{RetriableException, WakeupException} diff --git a/common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KafkaMessagingProvider.scala b/common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KafkaMessagingProvider.scala index dd388952708..16c0b2132de 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KafkaMessagingProvider.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KafkaMessagingProvider.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.connector.kafka import java.util.Properties -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import org.apache.kafka.clients.admin.{AdminClient, AdminClientConfig, NewTopic} import org.apache.kafka.common.errors.{RetriableException, TopicExistsException} import pureconfig._ diff --git a/common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KafkaMetrics.scala b/common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KafkaMetrics.scala index d65c6c5bccf..28056a47360 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KafkaMetrics.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KafkaMetrics.scala @@ -17,9 +17,9 @@ package org.apache.openwhisk.connector.kafka -import akka.http.scaladsl.server.{Directives, Route} +import org.apache.pekko.http.scaladsl.server.{Directives, Route} import org.apache.kafka.common.{Metric, MetricName => JMetricName} -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ import spray.json._ import spray.json.DefaultJsonProtocol._ diff --git a/common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KafkaProducerConnector.scala b/common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KafkaProducerConnector.scala index 3c4a410d0fb..5cd6a91efd6 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KafkaProducerConnector.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KafkaProducerConnector.scala @@ -17,8 +17,8 @@ package org.apache.openwhisk.connector.kafka -import akka.actor.ActorSystem -import akka.pattern.after +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.pattern.after import org.apache.kafka.clients.producer._ import org.apache.kafka.common.errors._ import org.apache.kafka.common.serialization.StringSerializer diff --git a/common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KamonMetricsReporter.scala b/common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KamonMetricsReporter.scala index fbacc726e7c..30e1c242237 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KamonMetricsReporter.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KamonMetricsReporter.scala @@ -24,7 +24,7 @@ import kamon.Kamon import kamon.metric.{Counter, Gauge, Metric} import kamon.tag.TagSet import org.apache.kafka.common.MetricName -import org.apache.kafka.common.metrics.stats.Total +import org.apache.kafka.common.metrics.stats.CumulativeSum import org.apache.kafka.common.metrics.{KafkaMetric, MetricsReporter} import org.apache.openwhisk.core.ConfigKeys import pureconfig._ @@ -122,8 +122,8 @@ object KamonMetricsReporter { } def isCounterMetric(metric: KafkaMetric): Boolean = Try(metric.measurable()) match { - case Success(_: Total) => true - case _ => false + case Success(_: CumulativeSum) => true + case _ => false } def shouldIncludeMetric(m: MetricName): Boolean = { diff --git a/common/scala/src/main/scala/org/apache/openwhisk/connector/lean/LeanMessagingProvider.scala b/common/scala/src/main/scala/org/apache/openwhisk/connector/lean/LeanMessagingProvider.scala index 2bcf27136a0..a7067ec4435 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/connector/lean/LeanMessagingProvider.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/connector/lean/LeanMessagingProvider.scala @@ -26,7 +26,7 @@ import scala.concurrent.duration.FiniteDuration import scala.util.Success import scala.util.Try -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import org.apache.openwhisk.common.Logging import org.apache.openwhisk.core.WhiskConfig import org.apache.openwhisk.core.connector.MessageConsumer diff --git a/common/scala/src/main/scala/org/apache/openwhisk/connector/lean/LeanProducer.scala b/common/scala/src/main/scala/org/apache/openwhisk/connector/lean/LeanProducer.scala index 2463d14101f..487f7848b29 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/connector/lean/LeanProducer.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/connector/lean/LeanProducer.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.connector.lean -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import scala.concurrent.Future import org.apache.openwhisk.common.Counter diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/WhiskConfig.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/WhiskConfig.scala index 6a16886fcf4..5f9e3236e45 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/WhiskConfig.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/WhiskConfig.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.core import java.io.File -import akka.http.scaladsl.model.Uri.normalize +import org.apache.pekko.http.scaladsl.model.Uri.normalize import org.apache.openwhisk.common.{Config, Logging} import scala.io.Source @@ -88,7 +88,7 @@ class WhiskConfig(requiredProperties: Map[String, String], val schedulerHost = this(WhiskConfig.schedulerHost) val schedulerRpcPort = this(WhiskConfig.schedulerRpcPort) - val schedulerAkkaPort = this(WhiskConfig.schedulerAkkaPort) + val schedulerPekkoPort = this(WhiskConfig.schedulerPekkoPort) } object WhiskConfig { @@ -193,11 +193,11 @@ object WhiskConfig { val actionInvokePerMinuteLimit = "limits.actions.invokes.perMinute" val actionInvokeConcurrentLimit = "limits.actions.invokes.concurrent" val triggerFirePerMinuteLimit = "limits.triggers.fires.perMinute" - val controllerSeedNodes = "akka.cluster.seed.nodes" + val controllerSeedNodes = "pekko.cluster.seed.nodes" val schedulerHost = "whisk.scheduler.endpoints.host" val schedulerRpcPort = "whisk.scheduler.endpoints.rpcPort" - val schedulerAkkaPort = "whisk.scheduler.endpoints.akkaPort" + val schedulerPekkoPort = "whisk.scheduler.endpoints.pekkoPort" } object ConfigKeys { diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/connector/Message.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/connector/Message.scala index 51e734254bf..85bcfd66900 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/connector/Message.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/connector/Message.scala @@ -23,7 +23,7 @@ import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.entity._ import scala.concurrent.duration._ -import akka.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.model.StatusCodes._ import java.util.concurrent.TimeUnit import org.apache.openwhisk.core.entity.ActivationResponse.{statusForCode, ERROR_FIELD} diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/connector/MessageConsumer.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/connector/MessageConsumer.scala index 8713b4afde5..8cceaab26c9 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/connector/MessageConsumer.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/connector/MessageConsumer.scala @@ -24,8 +24,8 @@ import scala.concurrent.blocking import scala.concurrent.duration._ import scala.util.Failure import org.apache.kafka.clients.consumer.CommitFailedException -import akka.actor.FSM -import akka.pattern.pipe +import org.apache.pekko.actor.FSM +import org.apache.pekko.pattern.pipe import org.apache.openwhisk.common.Logging import org.apache.openwhisk.common.TransactionId @@ -111,8 +111,8 @@ class MessageFeed(description: String, // Immutable Queue // although on the surface it seems to make sense to use an immutable variable with a mutable Queue, - // Akka Actor state defies the usual "prefer immutable" guideline in Scala, esp. w/ Collections. - // If, for some reason, this Queue was mutable and is accidentally leaked in say an Akka message, + // Pekko Actor state defies the usual "prefer immutable" guideline in Scala, esp. w/ Collections. + // If, for some reason, this Queue was mutable and is accidentally leaked in say an Pekko message, // another Actor or recipient would be able to mutate the internal state of this Actor. // Best practice dictates a mutable variable pointing at an immutable collection for this reason private var outstandingMessages = immutable.Queue.empty[(String, Int, Long, Array[Byte])] diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/connector/MessagingProvider.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/connector/MessagingProvider.scala index 73b8441adf7..dafac46c2b7 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/connector/MessagingProvider.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/connector/MessagingProvider.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.connector -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import scala.concurrent.duration.DurationInt import scala.concurrent.duration.FiniteDuration diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/ApacheBlockingContainerClient.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/ApacheBlockingContainerClient.scala index b366d28b107..529c5d671b1 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/ApacheBlockingContainerClient.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/ApacheBlockingContainerClient.scala @@ -56,7 +56,7 @@ protected[containerpool] case class RetryableConnectionError(t: Throwable) exten * It allows to POST a JSON object and receive JSON object back; that is the * content type and the accept headers are both 'application/json. * The reason we still use this class for the action container is a mysterious hang - * in the Akka http client where a future fails to properly timeout and we have not + * in the Pekko http client where a future fails to properly timeout and we have not * determined why that is. * * @param hostname the host name diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/Container.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/Container.scala index 7e22560f3a2..b27c4afac14 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/Container.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/Container.scala @@ -19,10 +19,10 @@ package org.apache.openwhisk.core.containerpool import java.time.Instant -import akka.actor.ActorSystem -import akka.event.Logging.InfoLevel -import akka.stream.scaladsl.Source -import akka.util.ByteString +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.event.Logging.InfoLevel +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.util.ByteString import pureconfig._ import pureconfig.generic.auto._ import spray.json.DefaultJsonProtocol._ @@ -246,8 +246,8 @@ trait Container { } } private def openConnections(timeout: FiniteDuration, maxConcurrent: Int) = { - if (Container.config.akkaClient) { - new AkkaContainerClient(addr.host, addr.port, timeout, 1024) + if (Container.config.pekkoClient) { + new PekkoContainerClient(addr.host, addr.port, timeout, 1024) } else { new ApacheBlockingContainerClient(s"${addr.host}:${addr.port}", timeout, maxConcurrent) } diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerFactory.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerFactory.scala index a7272d0a2f6..bb0815b6dca 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerFactory.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerFactory.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.containerpool -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.core.WhiskConfig import org.apache.openwhisk.core.entity.{ByteSize, ExecManifest, ExecutableWhiskAction, InvokerInstanceId} @@ -46,7 +46,7 @@ case class ContainerArgsConfig(network: String, case class ContainerPoolConfig(userMemory: ByteSize, concurrentPeekFactor: Double, - akkaClient: Boolean, + pekkoClient: Boolean, prewarmExpirationCheckInitDelay: FiniteDuration, prewarmExpirationCheckInterval: FiniteDuration, prewarmExpirationCheckIntervalVariance: Option[FiniteDuration], diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/AkkaContainerClient.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/PekkoContainerClient.scala similarity index 90% rename from common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/AkkaContainerClient.scala rename to common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/PekkoContainerClient.scala index e4958d2d239..6d522a26773 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/AkkaContainerClient.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/PekkoContainerClient.scala @@ -17,15 +17,15 @@ package org.apache.openwhisk.core.containerpool -import akka.actor.ActorSystem -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.marshalling.Marshal -import akka.http.scaladsl.model._ -import akka.http.scaladsl.model.headers.Accept -import akka.http.scaladsl.unmarshalling.Unmarshal -import akka.stream.StreamTcpException -import akka.stream.scaladsl.{Sink, Source} -import akka.util.ByteString +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.marshalling.Marshal +import org.apache.pekko.http.scaladsl.model._ +import org.apache.pekko.http.scaladsl.model.headers.Accept +import org.apache.pekko.http.scaladsl.unmarshalling.Unmarshal +import org.apache.pekko.stream.StreamTcpException +import org.apache.pekko.stream.scaladsl.{Sink, Source} +import org.apache.pekko.util.ByteString import org.apache.openwhisk.common.LoggingMarkers.CONTAINER_CLIENT_RETRIES import org.apache.openwhisk.common.{Logging, MetricEmitter, TransactionId} import org.apache.openwhisk.core.entity.ActivationResponse.{ContainerHttpError, _} @@ -45,7 +45,7 @@ import scala.util.control.NonFatal * This HTTP client is used only in the invoker to communicate with the action container. * It allows to POST a JSON object and receive JSON object back; that is the * content type and the accept headers are both 'application/json. - * This implementation uses the akka http host-level client API. + * This implementation uses the pekko http host-level client API. * NOTE: Keepalive is disabled to prevent issues with paused containers * * @param hostname the host name @@ -54,7 +54,7 @@ import scala.util.control.NonFatal * @param queueSize once all connections are used, how big of queue to allow for additional requests * @param retryInterval duration between retries for TCP connection errors */ -protected class AkkaContainerClient( +protected class PekkoContainerClient( hostname: String, port: Int, timeout: FiniteDuration, @@ -148,7 +148,7 @@ protected class AkkaContainerClient( Future.failed(ContainerHealthError(tid, endpoint)) case t: StreamTcpException if retry => if (timeout > Duration.Zero) { - akka.pattern.after(retryInterval, as.scheduler)({ + org.apache.pekko.pattern.after(retryInterval, as.scheduler)({ val newTimeout = timeout - (Instant.now.toEpochMilli - start.toEpochMilli).milliseconds retryingRequest(req, newTimeout, retry, reschedule, endpoint, retryCount + 1) }) @@ -181,8 +181,8 @@ protected class AkkaContainerClient( } } -object AkkaContainerClient { - private val queueSize = loadConfigOrThrow[Int]("akka.http.host-connection-pool.max-connections") +object PekkoContainerClient { + private val queueSize = loadConfigOrThrow[Int]("pekko.http.host-connection-pool.max-connections") /** A helper method to post one single request to a connection. Used for container tests. */ def post(host: String, port: Int, endPoint: String, content: JsValue, timeout: FiniteDuration)( @@ -190,7 +190,7 @@ object AkkaContainerClient { as: ActorSystem, ec: ExecutionContext, tid: TransactionId): (Int, Option[JsObject]) = { - val connection = new AkkaContainerClient(host, port, timeout, 1) + val connection = new PekkoContainerClient(host, port, timeout, 1) val response = executeRequest(connection, endPoint, content) val result = Await.result(response, timeout + 10.seconds) //additional timeout to complete futures connection.close() @@ -203,7 +203,7 @@ object AkkaContainerClient { as: ActorSystem, ec: ExecutionContext, tid: TransactionId): (Int, Option[JsArray]) = { - val connection = new AkkaContainerClient(host, port, timeout, 1) + val connection = new PekkoContainerClient(host, port, timeout, 1) val response = executeRequestForJsArray(connection, endPoint, content) val result = Await.result(response, timeout + 10.seconds) //additional timeout to complete futures connection.close() @@ -216,14 +216,14 @@ object AkkaContainerClient { tid: TransactionId, as: ActorSystem, ec: ExecutionContext): Seq[(Int, Option[JsObject])] = { - val connection = new AkkaContainerClient(host, port, timeout, queueSize) + val connection = new PekkoContainerClient(host, port, timeout, queueSize) val futureResults = contents.map { executeRequest(connection, endPoint, _) } val results = Await.result(Future.sequence(futureResults), timeout + 10.seconds) //additional timeout to complete futures connection.close() results } - private def executeRequest(connection: AkkaContainerClient, endpoint: String, content: JsValue)( + private def executeRequest(connection: PekkoContainerClient, endpoint: String, content: JsValue)( implicit logging: Logging, as: ActorSystem, ec: ExecutionContext, @@ -248,7 +248,7 @@ object AkkaContainerClient { res } - private def executeRequestForJsArray(connection: AkkaContainerClient, endpoint: String, content: JsValue)( + private def executeRequestForJsArray(connection: PekkoContainerClient, endpoint: String, content: JsValue)( implicit logging: Logging, as: ActorSystem, ec: ExecutionContext, diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/DockerToActivationFileLogStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/DockerToActivationFileLogStore.scala index 83267ba3e72..67eb6a79d1f 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/DockerToActivationFileLogStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/DockerToActivationFileLogStore.scala @@ -29,14 +29,14 @@ import java.nio.file.attribute.PosixFilePermission.{ import java.util.EnumSet import java.time.Instant -import akka.NotUsed -import akka.actor.ActorSystem -import akka.stream.alpakka.file.scaladsl.LogRotatorSink -import akka.stream.{Graph, RestartSettings, SinkShape, UniformFanOutShape} -import akka.stream.scaladsl.{Broadcast, Flow, GraphDSL, Keep, MergeHub, RestartSink, Sink, Source} -import akka.util.ByteString - -import org.apache.openwhisk.common.{AkkaLogging, TransactionId} +import org.apache.pekko.NotUsed +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream.connectors.file.scaladsl.LogRotatorSink +import org.apache.pekko.stream.{Graph, RestartSettings, SinkShape, UniformFanOutShape} +import org.apache.pekko.stream.scaladsl.{Broadcast, Flow, GraphDSL, Keep, MergeHub, RestartSink, Sink, Source} +import org.apache.pekko.util.ByteString + +import org.apache.openwhisk.common.{PekkoLogging, TransactionId} import org.apache.openwhisk.core.containerpool.Container import org.apache.openwhisk.core.entity.{ActivationLogs, ExecutableWhiskAction, Identity, WhiskActivation} import org.apache.openwhisk.core.entity.size._ @@ -59,7 +59,7 @@ import scala.concurrent.duration._ class DockerToActivationFileLogStore(system: ActorSystem, destinationDirectory: Path = Paths.get("logs")) extends DockerToActivationLogStore(system) { - private val logging = new AkkaLogging(system.log) + private val logging = new PekkoLogging(system.log) /** * End of an event as written to a file. Closes the json-object and also appends a newline. diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/DockerToActivationLogStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/DockerToActivationLogStore.scala index 0c8bf488c67..476baa33e1a 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/DockerToActivationLogStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/DockerToActivationLogStore.scala @@ -19,12 +19,12 @@ package org.apache.openwhisk.core.containerpool.logging import java.time.Instant -import akka.NotUsed -import akka.actor.ActorSystem -import akka.stream.scaladsl.Sink -import akka.stream.scaladsl.Flow -import akka.stream.scaladsl.Source -import akka.util.ByteString +import org.apache.pekko.NotUsed +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream.scaladsl.Sink +import org.apache.pekko.stream.scaladsl.Flow +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.util.ByteString import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.containerpool.Container import org.apache.openwhisk.core.entity._ diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/ElasticSearchLogStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/ElasticSearchLogStore.scala index 7c2faa9080e..9a7e96075dd 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/ElasticSearchLogStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/ElasticSearchLogStore.scala @@ -20,9 +20,9 @@ package org.apache.openwhisk.core.containerpool.logging import java.nio.file.{Path, Paths} import java.time.Instant -import akka.actor.ActorSystem -import akka.stream.scaladsl.Flow -import akka.http.scaladsl.model._ +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream.scaladsl.Flow +import org.apache.pekko.http.scaladsl.model._ import org.apache.openwhisk.core.entity.{ActivationId, ActivationLogs, Identity} import org.apache.openwhisk.core.containerpool.logging.ElasticSearchJsonProtocol._ import org.apache.openwhisk.core.ConfigKeys diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/ElasticSearchRestClient.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/ElasticSearchRestClient.scala index 04343dcddf6..e70166fdef8 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/ElasticSearchRestClient.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/ElasticSearchRestClient.scala @@ -19,11 +19,11 @@ package org.apache.openwhisk.core.containerpool.logging import scala.concurrent.{ExecutionContext, Future, Promise} import scala.util.{Either, Try} -import akka.actor.ActorSystem -import akka.http.scaladsl.model._ -import akka.http.scaladsl.model.HttpMethods.{GET, POST} -import akka.http.scaladsl.model.headers.Accept -import akka.stream.scaladsl.Flow +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model._ +import org.apache.pekko.http.scaladsl.model.HttpMethods.{GET, POST} +import org.apache.pekko.http.scaladsl.model.headers.Accept +import org.apache.pekko.stream.scaladsl.Flow import scala.util.Try import spray.json._ diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/LogDriverLogStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/LogDriverLogStore.scala index e4a587619d2..7914592bf7c 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/LogDriverLogStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/LogDriverLogStore.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.core.containerpool.logging import java.time.Instant -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.containerpool.Container import org.apache.openwhisk.core.entity.{ActivationId, ActivationLogs, ExecutableWhiskAction, Identity, WhiskActivation} diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/LogStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/LogStore.scala index 9d4838f32d7..2d81928cd37 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/LogStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/LogStore.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.core.containerpool.logging import java.time.Instant -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.containerpool.Container import org.apache.openwhisk.core.entity.{ActivationId, ActivationLogs, ExecutableWhiskAction, Identity, WhiskActivation} diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/SplunkLogStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/SplunkLogStore.scala index a65fe205087..05a03f2d65f 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/SplunkLogStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/SplunkLogStore.scala @@ -20,25 +20,25 @@ package org.apache.openwhisk.core.containerpool.logging import java.time.Instant import java.time.temporal.ChronoUnit -import akka.actor.ActorSystem -import akka.http.scaladsl.ConnectionContext -import akka.http.scaladsl.Http -import akka.http.scaladsl.client.RequestBuilding.Post -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.model.FormData -import akka.http.scaladsl.model.HttpRequest -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.Uri -import akka.http.scaladsl.model.Uri.Path -import akka.http.scaladsl.model.headers.Authorization -import akka.http.scaladsl.model.headers.BasicHttpCredentials -import akka.http.scaladsl.unmarshalling.Unmarshal -import akka.stream.OverflowStrategy -import akka.stream.QueueOfferResult -import akka.stream.scaladsl.Flow -import akka.stream.scaladsl.Keep -import akka.stream.scaladsl.Sink -import akka.stream.scaladsl.Source +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.ConnectionContext +import org.apache.pekko.http.scaladsl.Http +import org.apache.pekko.http.scaladsl.client.RequestBuilding.Post +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.model.FormData +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.Uri +import org.apache.pekko.http.scaladsl.model.Uri.Path +import org.apache.pekko.http.scaladsl.model.headers.Authorization +import org.apache.pekko.http.scaladsl.model.headers.BasicHttpCredentials +import org.apache.pekko.http.scaladsl.unmarshalling.Unmarshal +import org.apache.pekko.stream.OverflowStrategy +import org.apache.pekko.stream.QueueOfferResult +import org.apache.pekko.stream.scaladsl.Flow +import org.apache.pekko.stream.scaladsl.Keep +import org.apache.pekko.stream.scaladsl.Sink +import org.apache.pekko.stream.scaladsl.Source import javax.net.ssl.{SSLContext, SSLEngine} import pureconfig._ import pureconfig.generic.auto._ @@ -49,7 +49,7 @@ import scala.util.Failure import scala.util.Success import scala.util.Try import spray.json._ -import org.apache.openwhisk.common.AkkaLogging +import org.apache.openwhisk.common.PekkoLogging import org.apache.openwhisk.core.ConfigKeys import org.apache.openwhisk.core.entity.{ActivationId, ActivationLogs} import org.apache.openwhisk.core.database.UserContext @@ -89,7 +89,7 @@ class SplunkLogStore( extends LogDriverLogStore(actorSystem) { implicit val as = actorSystem implicit val ec = as.dispatcher - private val logging = new AkkaLogging(actorSystem.log) + private val logging = new PekkoLogging(actorSystem.log) private val splunkApi = Path / "services" / "search" / "jobs" //see http://docs.splunk.com/Documentation/Splunk/6.6.3/RESTREF/RESTsearch#search.2Fjobs @@ -177,7 +177,7 @@ class SplunkLogStore( .fields(splunkConfig.logStreamField) .convertTo[String]}: ${l.fields(splunkConfig.logMessageField).convertTo[String].trim}" - //based on http://doc.akka.io/docs/akka-http/10.0.6/scala/http/client-side/host-level.html + //based on https://pekko.apache.org/docs/pekko-http/current/client-side/host-level.html val queue = Source .queue[(HttpRequest, Promise[HttpResponse])](maxPendingRequests, OverflowStrategy.dropNew) diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/ActivationFileStorage.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/ActivationFileStorage.scala index dd41abc7ee6..ad795c02946 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/ActivationFileStorage.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/ActivationFileStorage.scala @@ -22,11 +22,11 @@ import java.nio.file.{Files, Path} import java.time.Instant import java.util.EnumSet -import akka.actor.ActorSystem -import akka.stream.RestartSettings -import akka.stream.alpakka.file.scaladsl.LogRotatorSink -import akka.stream.scaladsl.{Flow, MergeHub, RestartSink, Sink, Source} -import akka.util.ByteString +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream.RestartSettings +import org.apache.pekko.stream.connectors.file.scaladsl.LogRotatorSink +import org.apache.pekko.stream.scaladsl.{Flow, MergeHub, RestartSink, Sink, Source} +import org.apache.pekko.util.ByteString import org.apache.openwhisk.common.Logging import org.apache.openwhisk.core.containerpool.logging.ElasticSearchJsonProtocol._ import org.apache.openwhisk.core.entity._ diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/ActivationStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/ActivationStore.scala index 9981bff16f0..444b6a77ab0 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/ActivationStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/ActivationStore.scala @@ -18,8 +18,8 @@ package org.apache.openwhisk.core.database import java.time.Instant -import akka.actor.ActorSystem -import akka.http.scaladsl.model.HttpRequest +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model.HttpRequest import spray.json.JsObject import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.core.ConfigKeys diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/ArtifactActivationStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/ArtifactActivationStore.scala index 9b62f728824..dc0a0ae2424 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/ArtifactActivationStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/ArtifactActivationStore.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.core.database import java.time.Instant -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import spray.json.JsObject import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.core.entity._ diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/ArtifactStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/ArtifactStore.scala index b63269a0254..4b6868483a5 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/ArtifactStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/ArtifactStore.scala @@ -20,9 +20,9 @@ package org.apache.openwhisk.core.database import scala.concurrent.ExecutionContext import scala.concurrent.Future -import akka.http.scaladsl.model._ -import akka.stream.scaladsl._ -import akka.util.ByteString +import org.apache.pekko.http.scaladsl.model._ +import org.apache.pekko.stream.scaladsl._ +import org.apache.pekko.util.ByteString import spray.json.JsObject import org.apache.openwhisk.common.Logging import org.apache.openwhisk.common.TransactionId diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/ArtifactStoreProvider.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/ArtifactStoreProvider.scala index ace3f5e81d5..850c09624d7 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/ArtifactStoreProvider.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/ArtifactStoreProvider.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.database -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import com.typesafe.config.ConfigFactory import spray.json.RootJsonFormat import org.apache.openwhisk.common.Logging diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/ArtifactWithFileStorageActivationStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/ArtifactWithFileStorageActivationStore.scala index cba59b1c847..73a8a580836 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/ArtifactWithFileStorageActivationStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/ArtifactWithFileStorageActivationStore.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.core.database import java.nio.file.Paths -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.core.ConfigKeys import org.apache.openwhisk.core.entity.{DocInfo, _} diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/AttachmentStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/AttachmentStore.scala index facb698d6fb..c941d73d3b6 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/AttachmentStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/AttachmentStore.scala @@ -16,10 +16,10 @@ */ package org.apache.openwhisk.core.database -import akka.actor.ActorSystem -import akka.http.scaladsl.model.ContentType -import akka.stream.scaladsl.{Sink, Source} -import akka.util.ByteString +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model.ContentType +import org.apache.pekko.stream.scaladsl.{Sink, Source} +import org.apache.pekko.util.ByteString import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.core.entity.DocId import org.apache.openwhisk.spi.Spi diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/AttachmentSupport.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/AttachmentSupport.scala index afd1187ad72..1366464e0cf 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/AttachmentSupport.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/AttachmentSupport.scala @@ -19,11 +19,11 @@ package org.apache.openwhisk.core.database import java.util.Base64 -import akka.NotUsed -import akka.actor.ActorSystem -import akka.http.scaladsl.model.{ContentType, Uri} -import akka.stream.scaladsl.{Sink, Source} -import akka.util.ByteString +import org.apache.pekko.NotUsed +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model.{ContentType, Uri} +import org.apache.pekko.stream.scaladsl.{Sink, Source} +import org.apache.pekko.util.ByteString import spray.json.DefaultJsonProtocol import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.database.AttachmentSupport.MemScheme diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/Batcher.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/Batcher.scala index 4f72fe226e2..2d39d514e6e 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/Batcher.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/Batcher.scala @@ -17,14 +17,14 @@ package org.apache.openwhisk.core.database -import akka.Done -import akka.actor.ActorSystem +import org.apache.pekko.Done +import org.apache.pekko.actor.ActorSystem import scala.collection.immutable.Queue import scala.concurrent.{ExecutionContext, Future, Promise} import scala.util.{Failure, Success} -import akka.stream.{CompletionStrategy, OverflowStrategy} -import akka.stream.scaladsl.{Sink, Source} +import org.apache.pekko.stream.{CompletionStrategy, OverflowStrategy} +import org.apache.pekko.stream.scaladsl.{Sink, Source} /** * Enables batching of a type T. diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/CouchDbRestClient.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/CouchDbRestClient.scala index 823a1679af1..6dac29b9c40 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/CouchDbRestClient.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/CouchDbRestClient.scala @@ -20,11 +20,11 @@ package org.apache.openwhisk.core.database import java.net.URLEncoder import java.nio.charset.StandardCharsets -import akka.actor.ActorSystem -import akka.http.scaladsl.model._ -import akka.http.scaladsl.model.headers._ -import akka.stream.scaladsl._ -import akka.util.ByteString +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model._ +import org.apache.pekko.http.scaladsl.model.headers._ +import org.apache.pekko.stream.scaladsl._ +import org.apache.pekko.util.ByteString import spray.json.DefaultJsonProtocol._ import spray.json._ import org.apache.openwhisk.common.Logging diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/CouchDbRestStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/CouchDbRestStore.scala index 84b78fe7f37..8182d1bebc3 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/CouchDbRestStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/CouchDbRestStore.scala @@ -17,11 +17,11 @@ package org.apache.openwhisk.core.database -import akka.actor.ActorSystem -import akka.event.Logging.ErrorLevel -import akka.http.scaladsl.model._ -import akka.stream.scaladsl._ -import akka.util.ByteString +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.event.Logging.ErrorLevel +import org.apache.pekko.http.scaladsl.model._ +import org.apache.pekko.stream.scaladsl._ +import org.apache.pekko.util.ByteString import scala.concurrent.Await import scala.concurrent.duration._ @@ -74,7 +74,7 @@ class CouchDbRestStore[DocumentAbstraction <: DocumentSerializer](dbProtocol: St // This the the amount of allowed parallel requests for each entity, before batching starts. If there are already maxOpenDbRequests // and more documents need to be stored, then all arriving documents will be put into batches (if enabled) to avoid a long queue. - private val maxOpenDbRequests = system.settings.config.getInt("akka.http.host-connection-pool.max-connections") / 2 + private val maxOpenDbRequests = system.settings.config.getInt("pekko.http.host-connection-pool.max-connections") / 2 private val maxRetry = loadConfigOrThrow[Int]("whisk.activation-store.retry-config.max-tries") private val batcher: Batcher[JsObject, Either[ArtifactStoreException, DocInfo]] = diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/CouchDbStoreProvider.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/CouchDbStoreProvider.scala index 19c77f7d697..709c914095e 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/CouchDbStoreProvider.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/CouchDbStoreProvider.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.database -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import spray.json.RootJsonFormat import org.apache.openwhisk.common.Logging import org.apache.openwhisk.core.ConfigKeys diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/DocumentFactory.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/DocumentFactory.scala index b6bbef09578..d4c39001f0f 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/DocumentFactory.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/DocumentFactory.scala @@ -21,9 +21,9 @@ import java.io.InputStream import java.io.OutputStream import scala.concurrent.{Future, Promise} -import akka.http.scaladsl.model.ContentType -import akka.stream.IOResult -import akka.stream.scaladsl.StreamConverters +import org.apache.pekko.http.scaladsl.model.ContentType +import org.apache.pekko.stream.IOResult +import org.apache.pekko.stream.scaladsl.StreamConverters import spray.json.JsObject import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.entity.Attachments.Attached diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/RemoteCacheInvalidation.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/RemoteCacheInvalidation.scala index c5b5e019b3a..fa8843784dd 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/RemoteCacheInvalidation.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/RemoteCacheInvalidation.scala @@ -24,8 +24,8 @@ import scala.concurrent.duration.DurationInt import scala.util.Failure import scala.util.Success import scala.util.Try -import akka.actor.ActorSystem -import akka.actor.Props +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.actor.Props import spray.json._ import org.apache.openwhisk.common.Logging import org.apache.openwhisk.core.{ConfigKeys, WhiskConfig} diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/StoreUtils.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/StoreUtils.scala index 6a0c5df5770..8cd4a90f42a 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/StoreUtils.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/StoreUtils.scala @@ -19,10 +19,10 @@ package org.apache.openwhisk.core.database import java.security.MessageDigest -import akka.event.Logging.ErrorLevel -import akka.stream.SinkShape -import akka.stream.scaladsl.{Broadcast, Flow, GraphDSL, Keep, Sink} -import akka.util.ByteString +import org.apache.pekko.event.Logging.ErrorLevel +import org.apache.pekko.stream.SinkShape +import org.apache.pekko.stream.scaladsl.{Broadcast, Flow, GraphDSL, Keep, Sink} +import org.apache.pekko.util.ByteString import com.google.common.base.Throwables import spray.json.DefaultJsonProtocol._ import spray.json.{JsObject, JsValue, RootJsonFormat} diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/azblob/AzureBlobAttachmentStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/azblob/AzureBlobAttachmentStore.scala index b0ad05c3231..51080620359 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/azblob/AzureBlobAttachmentStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/azblob/AzureBlobAttachmentStore.scala @@ -19,15 +19,15 @@ package org.apache.openwhisk.core.database.azblob import java.time.OffsetDateTime -import akka.actor.ActorSystem -import akka.event.Logging -import akka.event.Logging.InfoLevel -import akka.http.scaladsl.Http -import akka.http.scaladsl.model.StatusCodes.NotFound -import akka.http.scaladsl.model.{ContentType, HttpRequest, HttpResponse, Uri} -import akka.http.scaladsl.unmarshalling.Unmarshal -import akka.stream.scaladsl.{Sink, Source} -import akka.util.{ByteString, ByteStringBuilder} +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.event.Logging +import org.apache.pekko.event.Logging.InfoLevel +import org.apache.pekko.http.scaladsl.Http +import org.apache.pekko.http.scaladsl.model.StatusCodes.NotFound +import org.apache.pekko.http.scaladsl.model.{ContentType, HttpRequest, HttpResponse, Uri} +import org.apache.pekko.http.scaladsl.unmarshalling.Unmarshal +import org.apache.pekko.stream.scaladsl.{Sink, Source} +import org.apache.pekko.util.{ByteString, ByteStringBuilder} import com.azure.storage.blob.sas.{BlobContainerSasPermission, BlobServiceSasSignatureValues} import com.azure.storage.blob.{BlobContainerAsyncClient, BlobContainerClientBuilder, BlobUrlParts} import com.azure.storage.common.StorageSharedKeyCredential diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBArtifactStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBArtifactStore.scala index 1ca87aff19e..2891db96554 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBArtifactStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBArtifactStore.scala @@ -18,11 +18,11 @@ package org.apache.openwhisk.core.database.cosmosdb import _root_.rx.RxReactiveStreams -import akka.actor.ActorSystem -import akka.event.Logging.InfoLevel -import akka.http.scaladsl.model.{ContentType, StatusCodes, Uri} -import akka.stream.scaladsl.{Sink, Source} -import akka.util.ByteString +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.event.Logging.InfoLevel +import org.apache.pekko.http.scaladsl.model.{ContentType, StatusCodes, Uri} +import org.apache.pekko.stream.scaladsl.{Sink, Source} +import org.apache.pekko.util.ByteString import com.microsoft.azure.cosmosdb._ import com.microsoft.azure.cosmosdb.internal.Constants.Properties import com.microsoft.azure.cosmosdb.rx.AsyncDocumentClient diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBArtifactStoreProvider.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBArtifactStoreProvider.scala index d9825d1a318..6b2ffca897b 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBArtifactStoreProvider.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBArtifactStoreProvider.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.core.database.cosmosdb import java.io.Closeable -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import com.microsoft.azure.cosmosdb.rx.AsyncDocumentClient import com.typesafe.config.ConfigFactory import org.apache.openwhisk.common.Logging diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/RetryMetricsCollector.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/RetryMetricsCollector.scala index dafdf9999f9..db332515ae2 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/RetryMetricsCollector.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/RetryMetricsCollector.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.database.cosmosdb -import akka.event.slf4j.SLF4JLogging +import org.apache.pekko.event.slf4j.SLF4JLogging import ch.qos.logback.classic.LoggerContext import ch.qos.logback.classic.spi.ILoggingEvent import ch.qos.logback.core.AppenderBase diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/elasticsearch/ElasticSearchActivationStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/elasticsearch/ElasticSearchActivationStore.scala index 097b26b391b..ec55ab022cc 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/elasticsearch/ElasticSearchActivationStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/elasticsearch/ElasticSearchActivationStore.scala @@ -17,10 +17,10 @@ package org.apache.openwhisk.core.database.elasticsearch -import akka.actor.ActorSystem -import akka.event.Logging.ErrorLevel -import akka.http.scaladsl.model._ -import akka.stream.scaladsl.Flow +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.event.Logging.ErrorLevel +import org.apache.pekko.http.scaladsl.model._ +import org.apache.pekko.stream.scaladsl.Flow import com.google.common.base.Throwables import com.sksamuel.elastic4s.http.search.SearchHit import com.sksamuel.elastic4s.http.{ElasticClient, ElasticProperties, NoOpRequestConfigCallback} @@ -77,7 +77,7 @@ class ElasticSearchActivationStore( private val esType = "_doc" private val maxOpenDbRequests = actorSystem.settings.config - .getInt("akka.http.host-connection-pool.max-connections") / 2 + .getInt("pekko.http.host-connection-pool.max-connections") / 2 private val maxRetry = loadConfigOrThrow[Int]("whisk.activation-store.retry-config.max-tries") private val batcher: Batcher[IndexRequest, Either[ArtifactStoreException, DocInfo]] = new Batcher(500, maxOpenDbRequests, maxRetry)(doStore(_, _)(TransactionId.dbBatcher)) diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/memory/MemoryArtifactStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/memory/MemoryArtifactStore.scala index e2293dd4b45..52ba55e8e10 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/memory/MemoryArtifactStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/memory/MemoryArtifactStore.scala @@ -19,10 +19,10 @@ package org.apache.openwhisk.core.database.memory import java.nio.charset.StandardCharsets.UTF_8 -import akka.actor.ActorSystem -import akka.http.scaladsl.model.{ContentType, Uri} -import akka.stream.scaladsl.{Sink, Source} -import akka.util.ByteString +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model.{ContentType, Uri} +import org.apache.pekko.stream.scaladsl.{Sink, Source} +import org.apache.pekko.util.ByteString import org.apache.openwhisk.common.{Logging, LoggingMarkers, TransactionId} import org.apache.openwhisk.core.ConfigKeys import org.apache.openwhisk.core.database.StoreUtils._ diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/memory/MemoryAttachmentStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/memory/MemoryAttachmentStore.scala index 271635ca22a..ec8ec9a433a 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/memory/MemoryAttachmentStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/memory/MemoryAttachmentStore.scala @@ -17,10 +17,10 @@ package org.apache.openwhisk.core.database.memory -import akka.actor.ActorSystem -import akka.http.scaladsl.model.ContentType -import akka.stream.scaladsl.{Keep, Sink, Source} -import akka.util.{ByteString, ByteStringBuilder} +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model.ContentType +import org.apache.pekko.stream.scaladsl.{Keep, Sink, Source} +import org.apache.pekko.util.{ByteString, ByteStringBuilder} import org.apache.openwhisk.common.LoggingMarkers.{ DATABASE_ATTS_DELETE, DATABASE_ATT_DELETE, diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/memory/NoopActivationStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/memory/NoopActivationStore.scala index fb881fff302..4101a794274 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/memory/NoopActivationStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/memory/NoopActivationStore.scala @@ -18,7 +18,7 @@ package org.apache.openwhisk.core.database.memory import java.time.Instant -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import org.apache.openwhisk.common.{Logging, PrintStreamLogging, TransactionId, WhiskInstants} import org.apache.openwhisk.core.database.{ ActivationStore, diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/mongodb/MongoDBArtifactStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/mongodb/MongoDBArtifactStore.scala index a7dd33edbf3..f7336a699c0 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/mongodb/MongoDBArtifactStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/mongodb/MongoDBArtifactStore.scala @@ -17,11 +17,11 @@ package org.apache.openwhisk.core.database.mongodb -import akka.actor.ActorSystem -import akka.event.Logging.ErrorLevel -import akka.http.scaladsl.model._ -import akka.stream.scaladsl._ -import akka.util.ByteString +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.event.Logging.ErrorLevel +import org.apache.pekko.http.scaladsl.model._ +import org.apache.pekko.stream.scaladsl._ +import org.apache.pekko.util.ByteString import com.mongodb.client.gridfs.model.GridFSUploadOptions import org.apache.openwhisk.common.{Logging, LoggingMarkers, TransactionId} import org.apache.openwhisk.core.database._ diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/mongodb/MongoDBArtifactStoreProvider.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/mongodb/MongoDBArtifactStoreProvider.scala index e7aa30584f8..1174b60cc6c 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/mongodb/MongoDBArtifactStoreProvider.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/mongodb/MongoDBArtifactStoreProvider.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.database.mongodb -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import org.apache.openwhisk.common.Logging import org.apache.openwhisk.core.ConfigKeys import org.apache.openwhisk.core.database._ diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/mongodb/MongoDBAsyncStreamSink.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/mongodb/MongoDBAsyncStreamSink.scala index 6a715589a98..cc3f3390aef 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/mongodb/MongoDBAsyncStreamSink.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/mongodb/MongoDBAsyncStreamSink.scala @@ -19,11 +19,11 @@ package org.apache.openwhisk.core.database.mongodb import java.nio.ByteBuffer -import akka.Done -import akka.stream.{Attributes, IOResult, Inlet, SinkShape} -import akka.stream.scaladsl.Sink -import akka.stream.stage.{AsyncCallback, GraphStageLogic, GraphStageWithMaterializedValue, InHandler} -import akka.util.ByteString +import org.apache.pekko.Done +import org.apache.pekko.stream.{Attributes, IOResult, Inlet, SinkShape} +import org.apache.pekko.stream.scaladsl.Sink +import org.apache.pekko.stream.stage.{AsyncCallback, GraphStageLogic, GraphStageWithMaterializedValue, InHandler} +import org.apache.pekko.util.ByteString import org.mongodb.scala.Completed import org.mongodb.scala.gridfs.{AsyncOutputStream} diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/mongodb/MongoDBAsyncStreamSource.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/mongodb/MongoDBAsyncStreamSource.scala index 1a7fad9f9e4..d7d40f110de 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/mongodb/MongoDBAsyncStreamSource.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/mongodb/MongoDBAsyncStreamSource.scala @@ -19,17 +19,17 @@ package org.apache.openwhisk.core.database.mongodb import java.nio.ByteBuffer -import akka.Done -import akka.stream.SourceShape -import akka.stream.Attributes -import akka.stream.Outlet -import akka.stream.IOResult -import akka.stream.scaladsl.Source -import akka.stream.stage.GraphStageLogic -import akka.stream.stage.OutHandler -import akka.stream.stage.GraphStageWithMaterializedValue -import akka.stream.stage.AsyncCallback -import akka.util.ByteString +import org.apache.pekko.Done +import org.apache.pekko.stream.SourceShape +import org.apache.pekko.stream.Attributes +import org.apache.pekko.stream.Outlet +import org.apache.pekko.stream.IOResult +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.stream.stage.GraphStageLogic +import org.apache.pekko.stream.stage.OutHandler +import org.apache.pekko.stream.stage.GraphStageWithMaterializedValue +import org.apache.pekko.stream.stage.AsyncCallback +import org.apache.pekko.util.ByteString import org.mongodb.scala.Completed import org.mongodb.scala.gridfs.AsyncInputStream diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/s3/CloudFrontSigner.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/s3/CloudFrontSigner.scala index 0c36bc4528c..75ae942886b 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/s3/CloudFrontSigner.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/s3/CloudFrontSigner.scala @@ -22,7 +22,7 @@ import java.security.PrivateKey import java.time.Instant import java.util.Date -import akka.http.scaladsl.model.Uri +import org.apache.pekko.http.scaladsl.model.Uri import com.amazonaws.auth.PEM import com.amazonaws.services.cloudfront.CloudFrontUrlSigner import com.amazonaws.services.cloudfront.util.SignerUtils diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStore.scala index 10c65ea967a..499c7268e85 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStore.scala @@ -17,18 +17,18 @@ package org.apache.openwhisk.core.database.s3 -import akka.actor.ActorSystem -import akka.event.Logging -import akka.http.scaladsl.Http -import akka.http.scaladsl.model.headers.CacheDirectives._ -import akka.http.scaladsl.model.headers._ -import akka.http.scaladsl.model.{ContentType, HttpRequest, HttpResponse, Uri} -import akka.http.scaladsl.unmarshalling.Unmarshal -import akka.stream.alpakka.s3.headers.CannedAcl -import akka.stream.alpakka.s3.scaladsl.S3 -import akka.stream.alpakka.s3.{S3Attributes, S3Exception, S3Headers, S3Settings} -import akka.stream.scaladsl.{Sink, Source} -import akka.util.ByteString +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.event.Logging +import org.apache.pekko.http.scaladsl.Http +import org.apache.pekko.http.scaladsl.model.headers.CacheDirectives._ +import org.apache.pekko.http.scaladsl.model.headers._ +import org.apache.pekko.http.scaladsl.model.{ContentType, HttpRequest, HttpResponse, Uri} +import org.apache.pekko.http.scaladsl.unmarshalling.Unmarshal +import org.apache.pekko.stream.connectors.s3.headers.CannedAcl +import org.apache.pekko.stream.connectors.s3.scaladsl.S3 +import org.apache.pekko.stream.connectors.s3.{S3Attributes, S3Exception, S3Headers, S3Settings} +import org.apache.pekko.stream.scaladsl.{Sink, Source} +import org.apache.pekko.util.ByteString import com.typesafe.config.Config import org.apache.openwhisk.common.LoggingMarkers.{ DATABASE_ATTS_DELETE, @@ -49,7 +49,7 @@ import scala.concurrent.{ExecutionContext, Future} import scala.reflect.ClassTag object S3AttachmentStoreProvider extends AttachmentStoreProvider { - val alpakkaConfigKey = s"${ConfigKeys.s3}.alpakka" + val pekkoConnectorsConfigKey = s"${ConfigKeys.s3}.pekko-connectors" case class S3Config(bucket: String, prefix: Option[String], cloudFrontConfig: Option[CloudFrontConfig] = None) { def prefixFor[D](implicit tag: ClassTag[D]): String = { val className = tag.runtimeClass.getSimpleName.toLowerCase @@ -71,7 +71,7 @@ object S3AttachmentStoreProvider extends AttachmentStoreProvider { new S3AttachmentStore(s3Settings(config), s3config.bucket, s3config.prefixFor[D], s3config.signer) } - private def s3Settings(config: Config) = S3Settings(config.getConfig(alpakkaConfigKey)) + private def s3Settings(config: Config) = S3Settings(config.getConfig(pekkoConnectorsConfigKey)) } @@ -181,10 +181,10 @@ class S3AttachmentStore(s3Settings: S3Settings, bucket: String, prefix: String, future.flatMap { case HttpResponse(status, _, entity, _) if status.isSuccess() && !status.isRedirection() => Future.successful(Some(entity.dataBytes)) - case HttpResponse(_, _, entity, _) => + case HttpResponse(status, _, entity, _) => Unmarshal(entity).to[String].map { err => //With CloudFront also the error message confirms to same S3 exception format - val exp = new S3Exception(err) + val exp = S3Exception(err, status) if (isMissingKeyException(exp)) None else throw exp } } diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/entity/ActivationResult.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/entity/ActivationResult.scala index 42961425fa6..fe9d699dfe3 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/entity/ActivationResult.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/entity/ActivationResult.scala @@ -18,7 +18,7 @@ package org.apache.openwhisk.core.entity import scala.util.Try -import akka.http.scaladsl.model.StatusCodes.{OK, ServiceUnavailable} +import org.apache.pekko.http.scaladsl.model.StatusCodes.{OK, ServiceUnavailable} import spray.json._ import spray.json.DefaultJsonProtocol import org.apache.openwhisk.common.Logging diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/entity/Attachments.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/entity/Attachments.scala index c6b30c83789..7a8318d3654 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/entity/Attachments.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/entity/Attachments.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.entity -import akka.http.scaladsl.model.ContentType +import org.apache.pekko.http.scaladsl.model.ContentType import spray.json.DefaultJsonProtocol._ import spray.json._ import org.apache.openwhisk.core.entity.size._ diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/entity/BasicAuthenticationAuthKey.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/entity/BasicAuthenticationAuthKey.scala index 5bcd839294f..7d61ccc2a18 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/entity/BasicAuthenticationAuthKey.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/entity/BasicAuthenticationAuthKey.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.entity -import akka.http.scaladsl.model.headers.{BasicHttpCredentials, HttpCredentials} +import org.apache.pekko.http.scaladsl.model.headers.{BasicHttpCredentials, HttpCredentials} import spray.json._ import spray.json.DefaultJsonProtocol._ diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/entity/GenericAuthKey.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/entity/GenericAuthKey.scala index 6c850042759..59d5f9bdae6 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/entity/GenericAuthKey.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/entity/GenericAuthKey.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.entity -import akka.http.scaladsl.model.headers.HttpCredentials +import org.apache.pekko.http.scaladsl.model.headers.HttpCredentials import spray.json._ /** diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/entity/WhiskAction.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/entity/WhiskAction.scala index d9ebfd16e19..08f3429b14d 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/entity/WhiskAction.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/entity/WhiskAction.scala @@ -21,7 +21,7 @@ import java.io.{ByteArrayInputStream, ByteArrayOutputStream} import java.nio.charset.StandardCharsets.UTF_8 import java.time.Instant import java.util.Base64 -import akka.http.scaladsl.model.ContentTypes +import org.apache.pekko.http.scaladsl.model.ContentTypes import scala.concurrent.ExecutionContext import scala.concurrent.Future diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/entity/WhiskStore.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/entity/WhiskStore.scala index 7ae959ed2b0..eabc185c577 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/entity/WhiskStore.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/entity/WhiskStore.scala @@ -22,7 +22,7 @@ import java.time.Instant import scala.concurrent.Future import scala.language.postfixOps import scala.util.Try -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import spray.json.JsNumber import spray.json.JsObject import spray.json.JsString diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/etcd/EtcdWorker.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/etcd/EtcdWorker.scala index ac1b36d1b9b..b6bd9640426 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/etcd/EtcdWorker.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/etcd/EtcdWorker.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.etcd -import akka.actor.{Actor, ActorRef, ActorSystem, Props, Timers} +import org.apache.pekko.actor.{Actor, ActorRef, ActorSystem, Props, Timers} import io.grpc.StatusRuntimeException import org.apache.openwhisk.common.Logging import org.apache.openwhisk.core.etcd.EtcdWorker.GetLeaseAndRetry diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/service/DataManagementService.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/service/DataManagementService.scala index c03070bf8dc..ce2c8eb5131 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/service/DataManagementService.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/service/DataManagementService.scala @@ -17,8 +17,8 @@ package org.apache.openwhisk.core.service -import akka.actor.{Actor, ActorRef, ActorRefFactory, ActorSystem, Props} -import akka.util.Timeout +import org.apache.pekko.actor.{Actor, ActorRef, ActorRefFactory, ActorSystem, Props} +import org.apache.pekko.util.Timeout import org.apache.openwhisk.common.Logging import org.apache.openwhisk.core.ConfigKeys import org.apache.openwhisk.core.etcd.{EtcdFollower, EtcdLeader} diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/service/LeaseKeepAliveService.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/service/LeaseKeepAliveService.scala index 092f7186fbc..2338e30fc2b 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/service/LeaseKeepAliveService.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/service/LeaseKeepAliveService.scala @@ -17,9 +17,9 @@ package org.apache.openwhisk.core.service -import akka.actor.Status.{Failure => FailureMessage} -import akka.actor.{ActorRef, ActorSystem, Cancellable, FSM, Props, Stash} -import akka.pattern.pipe +import org.apache.pekko.actor.Status.{Failure => FailureMessage} +import org.apache.pekko.actor.{ActorRef, ActorSystem, Cancellable, FSM, Props, Stash} +import org.apache.pekko.pattern.pipe import org.apache.openwhisk.common.{Logging, LoggingMarkers, MetricEmitter} import org.apache.openwhisk.core.ConfigKeys import org.apache.openwhisk.core.entity.InstanceId diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/service/WatcherService.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/service/WatcherService.scala index c6277a77f05..9fcf07c66fb 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/service/WatcherService.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/service/WatcherService.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.service -import akka.actor.{Actor, ActorRef, ActorSystem, Props} +import org.apache.pekko.actor.{Actor, ActorRef, ActorSystem, Props} import com.ibm.etcd.api.Event.EventType import com.ibm.etcd.client.kv.KvClient import org.apache.openwhisk.common.{GracefulShutdown, Logging} diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNComponentActor.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNComponentActor.scala index 7409204e57c..777c7e9b129 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNComponentActor.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNComponentActor.scala @@ -17,8 +17,8 @@ package org.apache.openwhisk.core.yarn -import akka.actor.{Actor, ActorSystem} -import akka.http.scaladsl.model.{HttpMethods, StatusCodes} +import org.apache.pekko.actor.{Actor, ActorSystem} +import org.apache.pekko.http.scaladsl.model.{HttpMethods, StatusCodes} import org.apache.openwhisk.common.Logging import org.apache.openwhisk.core.entity.ExecManifest.ImageName import org.apache.openwhisk.core.yarn.YARNComponentActor.{CreateContainerAsync, RemoveContainer} diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNContainerFactory.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNContainerFactory.scala index d27df81096d..fab997307db 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNContainerFactory.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNContainerFactory.scala @@ -17,10 +17,10 @@ package org.apache.openwhisk.core.yarn -import akka.actor.{ActorRef, ActorSystem, Props} -import akka.http.scaladsl.model.{HttpMethods, StatusCodes} -import akka.pattern.ask -import akka.util.Timeout +import org.apache.pekko.actor.{ActorRef, ActorSystem, Props} +import org.apache.pekko.http.scaladsl.model.{HttpMethods, StatusCodes} +import org.apache.pekko.pattern.ask +import org.apache.pekko.util.Timeout import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.core.containerpool._ import org.apache.openwhisk.core.entity.ExecManifest.ImageName diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNContainerInfoActor.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNContainerInfoActor.scala index fab9b535fa3..dfcbc638512 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNContainerInfoActor.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNContainerInfoActor.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.yarn -import akka.actor.{Actor, ActorRef, ActorSystem} +import org.apache.pekko.actor.{Actor, ActorRef, ActorSystem} import org.apache.openwhisk.common.Logging import org.apache.openwhisk.core.containerpool.{ContainerAddress, ContainerId} import org.apache.openwhisk.core.entity.ExecManifest.ImageName diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNRESTUtil.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNRESTUtil.scala index 472cfb4840b..8894978c30d 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNRESTUtil.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNRESTUtil.scala @@ -20,7 +20,7 @@ package org.apache.openwhisk.core.yarn import java.nio.charset.StandardCharsets import java.security.Principal -import akka.http.scaladsl.model.{HttpMethod, HttpMethods, StatusCode, StatusCodes} +import org.apache.pekko.http.scaladsl.model.{HttpMethod, HttpMethods, StatusCode, StatusCodes} import javax.security.sasl.AuthenticationException import org.apache.commons.io.IOUtils import org.apache.http.auth.{AuthSchemeProvider, AuthScope, Credentials} diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNTask.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNTask.scala index 0f988536e8a..f627a3e7c58 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNTask.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNTask.scala @@ -19,9 +19,9 @@ package org.apache.openwhisk.core.yarn import java.time.Instant -import akka.actor.{ActorRef, ActorSystem} -import akka.stream.scaladsl.Source -import akka.util.{ByteString, Timeout} +import org.apache.pekko.actor.{ActorRef, ActorSystem} +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.util.{ByteString, Timeout} import spray.json._ import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.core.containerpool.{Container, ContainerAddress, ContainerId} @@ -29,7 +29,7 @@ import org.apache.openwhisk.core.containerpool.logging.LogLine import org.apache.openwhisk.core.entity.ByteSize import org.apache.openwhisk.core.entity.ExecManifest.ImageName import org.apache.openwhisk.core.yarn.YARNComponentActor.RemoveContainer -import akka.pattern.ask +import org.apache.pekko.pattern.ask import scala.concurrent.duration._ import scala.concurrent.{ExecutionContext, Future} diff --git a/common/scala/src/main/scala/org/apache/openwhisk/http/BasicHttpService.scala b/common/scala/src/main/scala/org/apache/openwhisk/http/BasicHttpService.scala index 28ebc7e2ba4..02b3a1fc9ad 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/http/BasicHttpService.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/http/BasicHttpService.scala @@ -17,13 +17,13 @@ package org.apache.openwhisk.http -import akka.actor.ActorSystem -import akka.event.Logging -import akka.http.scaladsl.{Http, ServerBuilder} -import akka.http.scaladsl.model.{HttpRequest, _} -import akka.http.scaladsl.server.RouteResult.Rejected -import akka.http.scaladsl.server._ -import akka.http.scaladsl.server.directives._ +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.event.Logging +import org.apache.pekko.http.scaladsl.{Http, ServerBuilder} +import org.apache.pekko.http.scaladsl.model.{HttpRequest, _} +import org.apache.pekko.http.scaladsl.server.RouteResult.Rejected +import org.apache.pekko.http.scaladsl.server._ +import org.apache.pekko.http.scaladsl.server.directives._ import kamon.metric.MeasurementUnit import spray.json._ @@ -35,7 +35,7 @@ import scala.concurrent.duration.DurationInt import scala.concurrent.{Await, Future} /** - * This trait extends the Akka Directives and Actor with logging and transaction counting + * This trait extends the Pekko Directives and Actor with logging and transaction counting * facilities common to all OpenWhisk REST services. */ trait BasicHttpService extends Directives { @@ -188,7 +188,7 @@ object BasicHttpService { } } - /** Rejection handler to terminate connection on a bad request. Delegates to Akka handler. */ + /** Rejection handler to terminate connection on a bad request. Delegates to Pekko handler. */ def customRejectionHandler(implicit transid: TransactionId) = { RejectionHandler.default.mapRejectionResponse { case res @ HttpResponse(_, _, ent: HttpEntity.Strict, _) => diff --git a/common/scala/src/main/scala/org/apache/openwhisk/http/BasicRasService.scala b/common/scala/src/main/scala/org/apache/openwhisk/http/BasicRasService.scala index cea06f431ad..2698c048a9f 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/http/BasicRasService.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/http/BasicRasService.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.http -import akka.event.Logging +import org.apache.pekko.event.Logging import org.apache.openwhisk.common.{MetricsRoute, TransactionId} /** diff --git a/common/scala/src/main/scala/org/apache/openwhisk/http/CorsSettings.scala b/common/scala/src/main/scala/org/apache/openwhisk/http/CorsSettings.scala index 0bc20f130ef..58c9f88514d 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/http/CorsSettings.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/http/CorsSettings.scala @@ -17,13 +17,13 @@ package org.apache.openwhisk.http -import akka.http.scaladsl.model.HttpMethods._ -import akka.http.scaladsl.model.headers.{ +import org.apache.pekko.http.scaladsl.model.HttpMethods._ +import org.apache.pekko.http.scaladsl.model.headers.{ `Access-Control-Allow-Headers`, `Access-Control-Allow-Methods`, `Access-Control-Allow-Origin` } -import akka.http.scaladsl.server.Directives +import org.apache.pekko.http.scaladsl.server.Directives /** * Defines the CORS settings for the REST APIs and Web Actions. diff --git a/common/scala/src/main/scala/org/apache/openwhisk/http/ErrorResponse.scala b/common/scala/src/main/scala/org/apache/openwhisk/http/ErrorResponse.scala index 41e2f866175..ca101307d93 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/http/ErrorResponse.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/http/ErrorResponse.scala @@ -20,13 +20,13 @@ package org.apache.openwhisk.http import scala.concurrent.duration.Duration import scala.concurrent.duration.FiniteDuration import scala.util.Try -import akka.http.scaladsl.model.StatusCode -import akka.http.scaladsl.model.StatusCodes.Forbidden -import akka.http.scaladsl.model.StatusCodes.NotFound -import akka.http.scaladsl.model.MediaType -import akka.http.scaladsl.server.Directives -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonMarshaller -import akka.http.scaladsl.server.StandardRoute +import org.apache.pekko.http.scaladsl.model.StatusCode +import org.apache.pekko.http.scaladsl.model.StatusCodes.Forbidden +import org.apache.pekko.http.scaladsl.model.StatusCodes.NotFound +import org.apache.pekko.http.scaladsl.model.MediaType +import org.apache.pekko.http.scaladsl.server.Directives +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonMarshaller +import org.apache.pekko.http.scaladsl.server.StandardRoute import spray.json._ import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.entity.SizeError diff --git a/common/scala/src/main/scala/org/apache/openwhisk/http/LenientSprayJsonSupport.scala b/common/scala/src/main/scala/org/apache/openwhisk/http/LenientSprayJsonSupport.scala index 22b952e5df6..2cf22c35d0a 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/http/LenientSprayJsonSupport.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/http/LenientSprayJsonSupport.scala @@ -17,8 +17,8 @@ package org.apache.openwhisk.http -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport -import akka.http.scaladsl.unmarshalling.{FromEntityUnmarshaller, Unmarshaller} +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport +import org.apache.pekko.http.scaladsl.unmarshalling.{FromEntityUnmarshaller, Unmarshaller} import spray.json.JsValue object LenientSprayJsonSupport extends SprayJsonSupport { diff --git a/common/scala/src/main/scala/org/apache/openwhisk/http/PoolingRestClient.scala b/common/scala/src/main/scala/org/apache/openwhisk/http/PoolingRestClient.scala index cd8d5a77e61..eb9c450d069 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/http/PoolingRestClient.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/http/PoolingRestClient.scala @@ -17,16 +17,16 @@ package org.apache.openwhisk.http -import akka.actor.ActorSystem -import akka.http.scaladsl.Http -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.marshalling._ -import akka.http.scaladsl.model._ -import akka.http.scaladsl.settings.ConnectionPoolSettings -import akka.http.scaladsl.unmarshalling._ -import akka.stream.scaladsl.{Flow, _} -import akka.stream.{KillSwitches, QueueOfferResult} -import org.apache.openwhisk.common.AkkaLogging +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.Http +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.marshalling._ +import org.apache.pekko.http.scaladsl.model._ +import org.apache.pekko.http.scaladsl.settings.ConnectionPoolSettings +import org.apache.pekko.http.scaladsl.unmarshalling._ +import org.apache.pekko.stream.scaladsl.{Flow, _} +import org.apache.pekko.stream.{KillSwitches, QueueOfferResult} +import org.apache.openwhisk.common.PekkoLogging import spray.json._ import scala.concurrent.duration._ @@ -37,7 +37,7 @@ import scala.util.{Failure, Success, Try} * Http client to talk to a known host. * * This class only handles the basic communication to the proper endpoints. It is up to its clients to interpret the - * results. It is built on akka-http host-level connection pools; compared to single requests, it saves some time + * results. It is built on pekko-http host-level connection pools; compared to single requests, it saves some time * on each request because it doesn't need to look up the pool corresponding to the host. It is also easier to add an * extra queueing mechanism. */ @@ -50,7 +50,7 @@ class PoolingRestClient( timeout: Option[FiniteDuration] = None)(implicit system: ActorSystem, ec: ExecutionContext) { require(protocol == "http" || protocol == "https", "Protocol must be one of { http, https }.") - private val logging = new AkkaLogging(system.log) + private val logging = new PekkoLogging(system.log) //if specified, override the ClientConnection idle-timeout and keepalive socket option value private val timeoutSettings = { diff --git a/common/scala/src/main/scala/org/apache/openwhisk/utils/ExecutionContextFactory.scala b/common/scala/src/main/scala/org/apache/openwhisk/utils/ExecutionContextFactory.scala index 6250483191e..0be77be25af 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/utils/ExecutionContextFactory.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/utils/ExecutionContextFactory.scala @@ -25,16 +25,16 @@ import scala.concurrent.Promise import scala.concurrent.duration.FiniteDuration import scala.util.control.NonFatal -import akka.actor.ActorSystem -import akka.actor.Cancellable -import akka.actor.Scheduler +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.actor.Cancellable +import org.apache.pekko.actor.Scheduler object ExecutionContextFactory { private type CancellableFuture[T] = (Cancellable, Future[T]) /** - * akka.pattern.after has a memory drag issue: it opaquely + * org.apache.pekko.pattern.after has a memory drag issue: it opaquely * schedules an actor which consequently results in drag for the * timeout duration * diff --git a/common/scala/transformEnvironment.sh b/common/scala/transformEnvironment.sh index 7dfb6edee4f..10391d122d0 100755 --- a/common/scala/transformEnvironment.sh +++ b/common/scala/transformEnvironment.sh @@ -25,7 +25,7 @@ # # Examples: # CONFIG_whisk_loadbalancer_invokerBusyThreshold -> -Dwhisk.loadbalancer.invoker-busy-threshold -# CONFIG_akka_remote_netty_tcp_bindPort -> -Dakka.remote.netty.tcp.bind-port +# CONFIG_pekko_remote_netty_tcp_bindPort -> -Dpekko.remote.netty.tcp.bind-port # CONFIG_whisk_spi_LogStoreProvider -> -Dwhisk.spi.LogStoreProvider # diff --git a/core/controller/build.gradle b/core/controller/build.gradle index f6926d56c43..407c3424616 100644 --- a/core/controller/build.gradle +++ b/core/controller/build.gradle @@ -46,9 +46,9 @@ dependencies { implementation project(':core:invoker') implementation project(':core:scheduler') - implementation "com.lightbend.akka.management:akka-management-cluster-bootstrap_${gradle.scala.depVersion}:${gradle.akka_management.version}" - implementation "com.lightbend.akka.discovery:akka-discovery-kubernetes-api_${gradle.scala.depVersion}:${gradle.akka_management.version}" - implementation "com.lightbend.akka.discovery:akka-discovery-marathon-api_${gradle.scala.depVersion}:${gradle.akka_management.version}" + implementation "org.apache.pekko:pekko-management-cluster-bootstrap_${gradle.scala.depVersion}:${gradle.pekko_management.version}" + implementation "org.apache.pekko:pekko-discovery-kubernetes-api_${gradle.scala.depVersion}:${gradle.pekko_management.version}" + implementation "org.apache.pekko:pekko-discovery-marathon-api_${gradle.scala.depVersion}:${gradle.pekko_management.version}" } mainClassName = "org.apache.openwhisk.core.controller.Controller" diff --git a/core/controller/init.sh b/core/controller/init.sh index 9d399b5f22e..b202b5ee8f4 100644 --- a/core/controller/init.sh +++ b/core/controller/init.sh @@ -19,6 +19,6 @@ ./copyJMXFiles.sh export CONTROLLER_OPTS -CONTROLLER_OPTS="$CONTROLLER_OPTS -Dakka.remote.artery.bind.hostname=$(hostname -i) $(./transformEnvironment.sh)" +CONTROLLER_OPTS="$CONTROLLER_OPTS -Dpekko.remote.artery.bind.hostname=$(hostname -i) $(./transformEnvironment.sh)" exec controller/bin/controller "$@" diff --git a/core/controller/src/main/resources/application.conf b/core/controller/src/main/resources/application.conf index 7467b2df1c5..be8fa0d569d 100644 --- a/core/controller/src/main/resources/application.conf +++ b/core/controller/src/main/resources/application.conf @@ -17,15 +17,19 @@ # common logging configuration see common scala include "logging" -include "akka-http-version" +include "pekko-http-version" -# http://doc.akka.io/docs/akka-http/current/scala/http/configuration.html +# https://pekko.apache.org/docs/pekko-http/current/configuration.html # descriptions inlined below for convenience -akka.http { +pekko.http { server { + # Bind to all interfaces in containerized environments + bind-host = "0.0.0.0" + default-http-port = 10001 + # Description: # If a request hasn't been responded to after the time period set here - # a `akka.http.Timedout` message will be sent to the timeout handler. + # a `org.apache.pekko.http.Timedout` message will be sent to the timeout handler. # Set to `infinite` to completely disable request timeouts. # # Explaining the set value: @@ -83,9 +87,9 @@ akka.http { } } -# Check out all akka-remote-2.5.4 options here: -# http://doc.akka.io/docs/akka/2.5.4/scala/general/configuration.html#config-akka-remote -akka { +# Check out all pekko-remote options here: +# https://pekko.apache.org/docs/pekko/current/general/configuration-reference.html +pekko { java-flight-recorder.enabled = false remote { artery { @@ -97,7 +101,7 @@ akka { log-sent-messages = on } cluster { - # Disable legacy metrics in akka-cluster. + # Disable legacy metrics in pekko-cluster. metrics.enabled=off } } diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala index 329efbcd8c8..fd59d572eab 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala @@ -21,12 +21,12 @@ import scala.concurrent.Future import scala.concurrent.duration._ import scala.util.{Failure, Success, Try} import org.apache.kafka.common.errors.RecordTooLargeException -import akka.actor.ActorSystem -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.server.RequestContext -import akka.http.scaladsl.server.RouteResult -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.unmarshalling._ +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.server.RequestContext +import org.apache.pekko.http.scaladsl.server.RouteResult +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.unmarshalling._ import spray.json._ import spray.json.DefaultJsonProtocol._ import org.apache.openwhisk.common.TransactionId diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Activations.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Activations.scala index eb1c0f61966..b93a5307a31 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Activations.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Activations.scala @@ -22,10 +22,10 @@ import java.time.Instant import scala.concurrent.Future import scala.language.postfixOps import scala.util.{Failure, Success, Try} -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonMarshaller -import akka.http.scaladsl.model.StatusCodes.BadRequest -import akka.http.scaladsl.server.Directives -import akka.http.scaladsl.unmarshalling._ +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonMarshaller +import org.apache.pekko.http.scaladsl.model.StatusCodes.BadRequest +import org.apache.pekko.http.scaladsl.server.Directives +import org.apache.pekko.http.scaladsl.unmarshalling._ import spray.json.DefaultJsonProtocol.RootJsObjectFormat import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.ConfigKeys diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/ApiUtils.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/ApiUtils.scala index ec08f5b3004..7116386a056 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/ApiUtils.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/ApiUtils.scala @@ -23,14 +23,14 @@ import scala.concurrent.ExecutionContext import scala.concurrent.Future import scala.util.Failure import scala.util.Success -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.model.StatusCode -import akka.http.scaladsl.model.StatusCodes.Conflict -import akka.http.scaladsl.model.StatusCodes.InternalServerError -import akka.http.scaladsl.model.StatusCodes.NotFound -import akka.http.scaladsl.model.StatusCodes.OK -import akka.http.scaladsl.model.StatusCodes.NoContent -import akka.http.scaladsl.server.{Directives, RequestContext, RouteResult} +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.model.StatusCode +import org.apache.pekko.http.scaladsl.model.StatusCodes.Conflict +import org.apache.pekko.http.scaladsl.model.StatusCodes.InternalServerError +import org.apache.pekko.http.scaladsl.model.StatusCodes.NotFound +import org.apache.pekko.http.scaladsl.model.StatusCodes.OK +import org.apache.pekko.http.scaladsl.model.StatusCodes.NoContent +import org.apache.pekko.http.scaladsl.server.{Directives, RequestContext, RouteResult} import spray.json.DefaultJsonProtocol._ import spray.json.{JsObject, JsValue, RootJsonFormat} import org.apache.openwhisk.common.Logging diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/AuthenticatedRoute.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/AuthenticatedRoute.scala index 4ff3c6cad98..02eb2b24dd2 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/AuthenticatedRoute.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/AuthenticatedRoute.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.controller -import akka.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.server.Route import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.entity.Identity diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/AuthorizedRouteDispatcher.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/AuthorizedRouteDispatcher.scala index 75b003c5490..6c8078d46c7 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/AuthorizedRouteDispatcher.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/AuthorizedRouteDispatcher.scala @@ -24,14 +24,14 @@ import scala.util.Success import scala.util.Try import scala.concurrent.Future -import akka.http.scaladsl.server.Directives -import akka.http.scaladsl.model.HttpMethod -import akka.http.scaladsl.model.StatusCodes.Forbidden -import akka.http.scaladsl.model.StatusCodes.NotFound -import akka.http.scaladsl.server.RequestContext -import akka.http.scaladsl.server.RouteResult -import akka.http.scaladsl.model.StatusCodes.InternalServerError -import akka.http.scaladsl.server.Directive1 +import org.apache.pekko.http.scaladsl.server.Directives +import org.apache.pekko.http.scaladsl.model.HttpMethod +import org.apache.pekko.http.scaladsl.model.StatusCodes.Forbidden +import org.apache.pekko.http.scaladsl.model.StatusCodes.NotFound +import org.apache.pekko.http.scaladsl.server.RequestContext +import org.apache.pekko.http.scaladsl.server.RouteResult +import org.apache.pekko.http.scaladsl.model.StatusCodes.InternalServerError +import org.apache.pekko.http.scaladsl.server.Directive1 import org.apache.openwhisk.core.entitlement.Collection import org.apache.openwhisk.common.TransactionId diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/BasicAuthenticationDirective.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/BasicAuthenticationDirective.scala index 10703f09347..ac434f2a51c 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/BasicAuthenticationDirective.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/BasicAuthenticationDirective.scala @@ -17,10 +17,10 @@ package org.apache.openwhisk.core.controller -import akka.actor.ActorSystem -import akka.http.scaladsl.model.headers._ -import akka.http.scaladsl.server.Directives._ -import akka.http.scaladsl.server.directives.{AuthenticationDirective, AuthenticationResult} +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model.headers._ +import org.apache.pekko.http.scaladsl.server.Directives._ +import org.apache.pekko.http.scaladsl.server.directives.{AuthenticationDirective, AuthenticationResult} import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.core.database.NoDocumentException import org.apache.openwhisk.core.entity._ diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Controller.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Controller.scala index 51ce88a4c8b..e48cc6b31b4 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Controller.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Controller.scala @@ -17,14 +17,14 @@ package org.apache.openwhisk.core.controller -import akka.Done -import akka.actor.{ActorSystem, CoordinatedShutdown} -import akka.event.Logging.InfoLevel -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.model.headers.BasicHttpCredentials -import akka.http.scaladsl.model.{StatusCodes, Uri} -import akka.http.scaladsl.server.Route +import org.apache.pekko.Done +import org.apache.pekko.actor.{ActorSystem, CoordinatedShutdown} +import org.apache.pekko.event.Logging.InfoLevel +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.model.headers.BasicHttpCredentials +import org.apache.pekko.http.scaladsl.model.{StatusCodes, Uri} +import org.apache.pekko.http.scaladsl.server.Route import kamon.Kamon import org.apache.openwhisk.common.Https.HttpsConfig import org.apache.openwhisk.common._ @@ -56,7 +56,7 @@ import scala.util.{Failure, Success} * * It extends the BasicRasService so it includes a ping endpoint for monitoring. * - * Akka sends messages to akka Actors -- the Controller is an Actor, ready to receive messages. + * Pekko sends messages to pekko Actors -- the Controller is an Actor, ready to receive messages. * * It is possible to deploy a hot-standby controller. Each controller needs its own instance. This instance is a * consecutive numbering, starting with 0. @@ -67,7 +67,7 @@ import scala.util.{Failure, Success} * back to the base controller, there could be an inconsistency in the cache (e.g. if a user has updated an action). This * inconsistency will be resolved by its own after removing the cached item, 5 minutes after it has been generated. * - * Uses the Akka routing DSL: http://doc.akka.io/docs/akka-http/current/scala/http/routing-dsl/overview.html + * Uses the Pekko routing DSL: https://pekko.apache.org/docs/pekko-http/current/routing-dsl/index.html * * @param config A set of properties needed to run an instance of the controller service * @param instance if running in scale-out, a unique identifier for this instance in the group @@ -89,11 +89,11 @@ class Controller(val instance: ControllerInstanceId, logLevel = InfoLevel) /** - * A Route in Akka is technically a function taking a RequestContext as a parameter. + * A Route in Pekko is technically a function taking a RequestContext as a parameter. * - * The "~" Akka DSL operator composes two independent Routes, building a routing tree structure. + * The "~" Pekko DSL operator composes two independent Routes, building a routing tree structure. * - * @see http://doc.akka.io/docs/akka-http/current/scala/http/routing-dsl/routes.html#composing-routes + * @see https://pekko.apache.org/docs/pekko-http/current/routing-dsl/routes.html#composing-routes */ override def routes(implicit transid: TransactionId): Route = { super.routes ~ { @@ -287,7 +287,7 @@ object Controller { def main(args: Array[String]): Unit = { implicit val actorSystem = ActorSystem("controller-actor-system") - implicit val logger = new AkkaLogging(akka.event.Logging.getLogger(actorSystem, this)) + implicit val logger = new PekkoLogging(org.apache.pekko.event.Logging.getLogger(actorSystem, this)) start(args) } diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Entities.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Entities.scala index 102e5491627..99e32f9b02c 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Entities.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Entities.scala @@ -20,14 +20,14 @@ package org.apache.openwhisk.core.controller import scala.concurrent.Future import scala.language.postfixOps import scala.util.Try -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.model.StatusCodes.PayloadTooLarge -import akka.http.scaladsl.model.headers.RawHeader -import akka.http.scaladsl.server.Directive0 -import akka.http.scaladsl.server.Directives -import akka.http.scaladsl.server.RequestContext -import akka.http.scaladsl.server.Route -import akka.http.scaladsl.server.RouteResult +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.model.StatusCodes.PayloadTooLarge +import org.apache.pekko.http.scaladsl.model.headers.RawHeader +import org.apache.pekko.http.scaladsl.server.Directive0 +import org.apache.pekko.http.scaladsl.server.Directives +import org.apache.pekko.http.scaladsl.server.RequestContext +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.server.RouteResult import spray.json.JsonPrinter import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.entitlement.Privilege._ diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Limits.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Limits.scala index 0d54e7339e9..38bb13c8e82 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Limits.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Limits.scala @@ -17,9 +17,9 @@ package org.apache.openwhisk.core.controller -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.server.{Directive1, Directives} -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonMarshaller +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.server.{Directive1, Directives} +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonMarshaller import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.WhiskConfig import org.apache.openwhisk.core.entitlement.{Collection, Privilege, Resource} diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Namespaces.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Namespaces.scala index 49eb59da586..e76175feca6 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Namespaces.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Namespaces.scala @@ -17,9 +17,9 @@ package org.apache.openwhisk.core.controller -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.server.Directives -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.server.Directives +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ import spray.json.DefaultJsonProtocol._ import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.entitlement.Collection diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Packages.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Packages.scala index c524e9570b1..1c23a057c2a 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Packages.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Packages.scala @@ -19,10 +19,10 @@ package org.apache.openwhisk.core.controller import scala.concurrent.Future import scala.util.{Failure, Success} -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.server.{RequestContext, RouteResult} -import akka.http.scaladsl.unmarshalling.Unmarshaller +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.server.{RequestContext, RouteResult} +import org.apache.pekko.http.scaladsl.unmarshalling.Unmarshaller import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.controller.RestApiCommons.{ListLimit, ListSkip} import org.apache.openwhisk.core.database.{CacheChangeNotification, DocumentTypeMismatchException, NoDocumentException} diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/RestAPIs.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/RestAPIs.scala index 18db6c7bf81..69301f661a5 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/RestAPIs.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/RestAPIs.scala @@ -17,12 +17,12 @@ package org.apache.openwhisk.core.controller -import akka.actor.ActorSystem -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.model.Uri -import akka.http.scaladsl.server.directives.AuthenticationDirective -import akka.http.scaladsl.server.{Directives, Route} +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.model.Uri +import org.apache.pekko.http.scaladsl.server.directives.AuthenticationDirective +import org.apache.pekko.http.scaladsl.server.{Directives, Route} import pureconfig._ import pureconfig.generic.auto._ import spray.json.DefaultJsonProtocol._ @@ -85,9 +85,9 @@ protected[controller] object RestApiCommons { EntitlementProvider.requiredProperties ++ WhiskActionsApi.requiredProperties - import akka.http.scaladsl.model.HttpCharsets - import akka.http.scaladsl.model.MediaTypes.`application/json` - import akka.http.scaladsl.unmarshalling.{FromEntityUnmarshaller, Unmarshaller} + import org.apache.pekko.http.scaladsl.model.HttpCharsets + import org.apache.pekko.http.scaladsl.model.MediaTypes.`application/json` + import org.apache.pekko.http.scaladsl.unmarshalling.{FromEntityUnmarshaller, Unmarshaller} /** * Extract an empty entity into a JSON object. This is useful for the diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Rules.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Rules.scala index 62b7cacda1a..ef1c8893208 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Rules.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Rules.scala @@ -17,11 +17,11 @@ package org.apache.openwhisk.core.controller -import akka.actor.ActorSystem -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.server.StandardRoute -import akka.http.scaladsl.unmarshalling.Unmarshaller +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.server.StandardRoute +import org.apache.pekko.http.scaladsl.unmarshalling.Unmarshaller import spray.json.DeserializationException import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.controller.RestApiCommons.{ListLimit, ListSkip} diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Triggers.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Triggers.scala index 0c00e3a9b9c..952a9108399 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Triggers.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Triggers.scala @@ -21,16 +21,23 @@ import java.time.{Clock, Instant} import scala.collection.immutable.Map import scala.concurrent.Future import scala.util.Try -import akka.actor.ActorSystem -import akka.http.scaladsl.Http -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.model.HttpMethods.POST -import akka.http.scaladsl.model.StatusCodes.{Accepted, BadRequest, InternalServerError, NoContent, OK, ServerError} -import akka.http.scaladsl.model.Uri.Path -import akka.http.scaladsl.model.headers.{`Timeout-Access`, Authorization} -import akka.http.scaladsl.model._ -import akka.http.scaladsl.server.{RequestContext, RouteResult} -import akka.http.scaladsl.unmarshalling.{Unmarshal, Unmarshaller} +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.Http +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.model.HttpMethods.POST +import org.apache.pekko.http.scaladsl.model.StatusCodes.{ + Accepted, + BadRequest, + InternalServerError, + NoContent, + OK, + ServerError +} +import org.apache.pekko.http.scaladsl.model.Uri.Path +import org.apache.pekko.http.scaladsl.model.headers.{`Timeout-Access`, Authorization} +import org.apache.pekko.http.scaladsl.model._ +import org.apache.pekko.http.scaladsl.server.{RequestContext, RouteResult} +import org.apache.pekko.http.scaladsl.unmarshalling.{Unmarshal, Unmarshaller} import spray.json.DefaultJsonProtocol._ import pureconfig._ import pureconfig.generic.auto._ diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/WebActions.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/WebActions.scala index d4eaf8911cd..1b52112d8fe 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/WebActions.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/WebActions.scala @@ -20,29 +20,29 @@ package org.apache.openwhisk.core.controller import java.util.Base64 import scala.concurrent.Future import scala.util.{Failure, Success, Try} -import akka.http.scaladsl.model.HttpEntity.Empty -import akka.http.scaladsl.server.Directives -import akka.http.scaladsl.model.HttpMethod -import akka.http.scaladsl.model.HttpHeader -import akka.http.scaladsl.model.MediaType -import akka.http.scaladsl.model.MediaTypes -import akka.http.scaladsl.model.MediaTypes._ -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.model.StatusCode -import akka.http.scaladsl.model.headers.RawHeader -import akka.http.scaladsl.model.headers._ -import akka.http.scaladsl.model.Uri.Query -import akka.http.scaladsl.model.HttpEntity -import akka.http.scaladsl.server.Route -import akka.http.scaladsl.model.headers.`Content-Type` -import akka.http.scaladsl.model.headers.`Timeout-Access` -import akka.http.scaladsl.model.ContentType -import akka.http.scaladsl.model.ContentTypes -import akka.http.scaladsl.model.FormData -import akka.http.scaladsl.model.HttpMethods.OPTIONS -import akka.http.scaladsl.model.HttpCharsets -import akka.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.HttpEntity.Empty +import org.apache.pekko.http.scaladsl.server.Directives +import org.apache.pekko.http.scaladsl.model.HttpMethod +import org.apache.pekko.http.scaladsl.model.HttpHeader +import org.apache.pekko.http.scaladsl.model.MediaType +import org.apache.pekko.http.scaladsl.model.MediaTypes +import org.apache.pekko.http.scaladsl.model.MediaTypes._ +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.StatusCode +import org.apache.pekko.http.scaladsl.model.headers.RawHeader +import org.apache.pekko.http.scaladsl.model.headers._ +import org.apache.pekko.http.scaladsl.model.Uri.Query +import org.apache.pekko.http.scaladsl.model.HttpEntity +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.model.headers.`Content-Type` +import org.apache.pekko.http.scaladsl.model.headers.`Timeout-Access` +import org.apache.pekko.http.scaladsl.model.ContentType +import org.apache.pekko.http.scaladsl.model.ContentTypes +import org.apache.pekko.http.scaladsl.model.FormData +import org.apache.pekko.http.scaladsl.model.HttpMethods.OPTIONS +import org.apache.pekko.http.scaladsl.model.HttpCharsets +import org.apache.pekko.http.scaladsl.model.HttpResponse import spray.json._ import spray.json.DefaultJsonProtocol._ import WhiskWebActionsApi.MediaExtension @@ -317,7 +317,7 @@ protected[core] object WhiskWebActionsApi extends Directives { js: JsValue, transid: TransactionId) = { findContentTypeInHeader(headers, transid, `application/json`) match { - // use the default akka-http response marshaler for standard application/json + // use the default pekko-http response marshaler for standard application/json case Success(mediaType) if mediaType == `application/json` => respondWithHeaders(removeContentTypeHeader(headers)) { complete(code, js) diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/actions/PostActionActivation.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/actions/PostActionActivation.scala index db9a38d42c1..92e68bb4376 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/actions/PostActionActivation.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/actions/PostActionActivation.scala @@ -20,7 +20,7 @@ package org.apache.openwhisk.core.controller.actions import scala.concurrent.Future import scala.concurrent.duration.FiniteDuration -import akka.http.scaladsl.model.StatusCodes.BadRequest +import org.apache.pekko.http.scaladsl.model.StatusCodes.BadRequest import spray.json._ diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/actions/PrimitiveActions.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/actions/PrimitiveActions.scala index 694ef7fa05c..d6ec78fbd79 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/actions/PrimitiveActions.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/actions/PrimitiveActions.scala @@ -19,8 +19,8 @@ package org.apache.openwhisk.core.controller.actions import java.time.{Clock, Instant} -import akka.actor.ActorSystem -import akka.event.Logging.InfoLevel +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.event.Logging.InfoLevel import spray.json.DefaultJsonProtocol._ import spray.json._ import org.apache.openwhisk.common.tracing.WhiskTracerProvider diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/actions/SequenceActions.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/actions/SequenceActions.scala index 4490cf158ac..c91c95fe6f0 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/actions/SequenceActions.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/actions/SequenceActions.scala @@ -20,7 +20,7 @@ package org.apache.openwhisk.core.controller.actions import java.time.{Clock, Instant} import java.util.concurrent.atomic.AtomicReference -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import spray.json._ import spray.json.DefaultJsonProtocol._ import org.apache.openwhisk.common.{Logging, TransactionId, UserEvents} diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/Collection.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/Collection.scala index 9c651cba943..7c254610593 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/Collection.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/Collection.scala @@ -21,11 +21,11 @@ import org.apache.openwhisk.core.entitlement.Privilege._ import scala.concurrent.ExecutionContext import scala.concurrent.Future -import akka.http.scaladsl.model.HttpMethod -import akka.http.scaladsl.model.HttpMethods.DELETE -import akka.http.scaladsl.model.HttpMethods.GET -import akka.http.scaladsl.model.HttpMethods.POST -import akka.http.scaladsl.model.HttpMethods.PUT +import org.apache.pekko.http.scaladsl.model.HttpMethod +import org.apache.pekko.http.scaladsl.model.HttpMethods.DELETE +import org.apache.pekko.http.scaladsl.model.HttpMethods.GET +import org.apache.pekko.http.scaladsl.model.HttpMethods.POST +import org.apache.pekko.http.scaladsl.model.HttpMethods.PUT import org.apache.openwhisk.common.Logging import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.ConfigKeys diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/Entitlement.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/Entitlement.scala index 88086d20fbb..4d90665cd44 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/Entitlement.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/Entitlement.scala @@ -22,9 +22,9 @@ import scala.collection.immutable.Set import scala.concurrent.{ExecutionContext, Future} import scala.util.Failure import scala.util.Success -import akka.actor.ActorSystem -import akka.http.scaladsl.model.StatusCodes.Forbidden -import akka.http.scaladsl.model.StatusCodes.TooManyRequests +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model.StatusCodes.Forbidden +import org.apache.pekko.http.scaladsl.model.StatusCodes.TooManyRequests import org.apache.openwhisk.core.entitlement.Privilege.ACTIVATE import org.apache.openwhisk.core.entitlement.Privilege.REJECT import org.apache.openwhisk.common.{Logging, TransactionId, UserEvents} diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/FPCEntitlement.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/FPCEntitlement.scala index 3c5a3256968..f81fdccefec 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/FPCEntitlement.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/FPCEntitlement.scala @@ -18,8 +18,8 @@ package org.apache.openwhisk.core.entitlement import scala.concurrent.Future -import akka.actor.ActorSystem -import akka.http.scaladsl.model.StatusCodes.TooManyRequests +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model.StatusCodes.TooManyRequests import org.apache.openwhisk.common.{Logging, TransactionId, UserEvents} import org.apache.openwhisk.core.{ConfigKeys, WhiskConfig} import org.apache.openwhisk.core.connector.{EventMessage, Metric} diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/LocalEntitlement.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/LocalEntitlement.scala index a87394612eb..b41863e9334 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/LocalEntitlement.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/LocalEntitlement.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.core.entitlement import scala.collection.concurrent.TrieMap import scala.concurrent.Future -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import org.apache.openwhisk.common.Logging import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.WhiskConfig diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/PackageCollection.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/PackageCollection.scala index b53dcbc7d37..f623de1bd90 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/PackageCollection.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/PackageCollection.scala @@ -20,7 +20,7 @@ package org.apache.openwhisk.core.entitlement import scala.concurrent.ExecutionContext import scala.concurrent.Future -import akka.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.model.StatusCodes._ import org.apache.openwhisk.common.Logging import org.apache.openwhisk.common.TransactionId diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/CommonLoadBalancer.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/CommonLoadBalancer.scala index 2a002876dac..aafa06887e6 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/CommonLoadBalancer.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/CommonLoadBalancer.scala @@ -17,12 +17,12 @@ package org.apache.openwhisk.core.loadBalancer -import akka.actor.ActorRef +import org.apache.pekko.actor.ActorRef import java.nio.charset.StandardCharsets import java.util.concurrent.atomic.LongAdder -import akka.actor.ActorSystem -import akka.event.Logging.InfoLevel +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.event.Logging.InfoLevel import pureconfig._ import pureconfig.generic.auto._ import org.apache.openwhisk.common.LoggingMarkers._ diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/FPCPoolBalancer.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/FPCPoolBalancer.scala index 0889cf2f53e..e2615185bbc 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/FPCPoolBalancer.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/FPCPoolBalancer.scala @@ -20,10 +20,10 @@ package org.apache.openwhisk.core.loadBalancer import java.nio.charset.StandardCharsets import java.util.concurrent.ThreadLocalRandom import java.util.concurrent.atomic.LongAdder -import akka.actor.{Actor, ActorRef, ActorRefFactory, ActorSystem, Cancellable, Props} -import akka.event.Logging.InfoLevel -import akka.pattern.ask -import akka.util.Timeout +import org.apache.pekko.actor.{Actor, ActorRef, ActorRefFactory, ActorSystem, Cancellable, Props} +import org.apache.pekko.event.Logging.InfoLevel +import org.apache.pekko.pattern.ask +import org.apache.pekko.util.Timeout import org.apache.openwhisk.common.InvokerState.{Healthy, Offline, Unhealthy} import org.apache.openwhisk.common.LoggingMarkers._ import org.apache.openwhisk.common._ diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/FeedFactory.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/FeedFactory.scala index 9aaa62ab339..b3a006412e5 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/FeedFactory.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/FeedFactory.scala @@ -16,8 +16,8 @@ */ package org.apache.openwhisk.core.loadBalancer -import akka.actor.ActorRef -import akka.actor.ActorRefFactory +import org.apache.pekko.actor.ActorRef +import org.apache.pekko.actor.ActorRefFactory import org.apache.openwhisk.core.connector.MessagingProvider import scala.concurrent.Future diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/InvokerPoolFactory.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/InvokerPoolFactory.scala index fd7f9fa4e62..636c296a37f 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/InvokerPoolFactory.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/InvokerPoolFactory.scala @@ -16,8 +16,8 @@ */ package org.apache.openwhisk.core.loadBalancer -import akka.actor.ActorRef -import akka.actor.ActorRefFactory +import org.apache.pekko.actor.ActorRef +import org.apache.pekko.actor.ActorRefFactory import org.apache.openwhisk.core.connector.{ActivationMessage, MessageProducer, MessagingProvider, ResultMetadata} import org.apache.openwhisk.core.entity.InvokerInstanceId diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/InvokerSupervision.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/InvokerSupervision.scala index 24b0f3369e2..1e0b77a4bd1 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/InvokerSupervision.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/InvokerSupervision.scala @@ -24,12 +24,12 @@ import scala.concurrent.{Await, ExecutionContext, Future} import scala.concurrent.duration._ import scala.util.Failure import scala.util.Success -import akka.actor.{Actor, ActorRef, ActorRefFactory, FSM, Props} -import akka.actor.FSM.CurrentState -import akka.actor.FSM.SubscribeTransitionCallBack -import akka.actor.FSM.Transition -import akka.pattern.pipe -import akka.util.Timeout +import org.apache.pekko.actor.{Actor, ActorRef, ActorRefFactory, FSM, Props} +import org.apache.pekko.actor.FSM.CurrentState +import org.apache.pekko.actor.FSM.SubscribeTransitionCallBack +import org.apache.pekko.actor.FSM.Transition +import org.apache.pekko.pattern.pipe +import org.apache.pekko.util.Timeout import org.apache.openwhisk.common._ import org.apache.openwhisk.core.connector._ import org.apache.openwhisk.core.database.NoDocumentException @@ -83,7 +83,7 @@ class InvokerPool(childFactory: (ActorRefFactory, InvokerInstanceId) => ActorRef import InvokerState._ implicit val transid: TransactionId = TransactionId.invokerHealth - implicit val logging: Logging = new AkkaLogging(context.system.log) + implicit val logging: Logging = new PekkoLogging(context.system.log) implicit val timeout: Timeout = Timeout(5.seconds) implicit val ec: ExecutionContext = context.dispatcher @@ -265,7 +265,7 @@ class InvokerActor(invokerInstance: InvokerInstanceId, controllerInstance: Contr import InvokerState._ implicit val transid: TransactionId = TransactionId.invokerHealth - implicit val logging: Logging = new AkkaLogging(context.system.log) + implicit val logging: Logging = new PekkoLogging(context.system.log) val name = s"invoker${invokerInstance.toInt}" val healthyTimeout: FiniteDuration = 10.seconds @@ -329,7 +329,7 @@ class InvokerActor(invokerInstance: InvokerInstanceId, controllerInstance: Contr this, LoggingMarkers.LOADBALANCER_INVOKER_STATUS_CHANGE(newState.asString), s"$name is ${newState.asString}", - akka.event.Logging.WarningLevel) + org.apache.pekko.event.Logging.WarningLevel) case _ -> newState if newState.isUsable => logging.info(this, s"$name is ${newState.asString}") } diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/LeanBalancer.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/LeanBalancer.scala index 161ee148e65..94941b5ed63 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/LeanBalancer.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/LeanBalancer.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.loadBalancer -import akka.actor.{ActorRef, ActorSystem, Props} +import org.apache.pekko.actor.{ActorRef, ActorSystem, Props} import org.apache.openwhisk.common._ import org.apache.openwhisk.core.WhiskConfig._ import org.apache.openwhisk.core.connector._ diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/LoadBalancer.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/LoadBalancer.scala index d9a38c6d26f..75be2edd76c 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/LoadBalancer.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/LoadBalancer.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.loadBalancer -import akka.actor.{ActorRefFactory, ActorSystem, Props} +import org.apache.pekko.actor.{ActorRefFactory, ActorSystem, Props} import org.apache.openwhisk.common.{InvokerHealth, Logging, TransactionId} import org.apache.openwhisk.core.WhiskConfig import org.apache.openwhisk.core.connector._ diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/ShardingContainerPoolBalancer.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/ShardingContainerPoolBalancer.scala index 5f7b9f05cd6..bfa47ff8d10 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/ShardingContainerPoolBalancer.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/ShardingContainerPoolBalancer.scala @@ -17,15 +17,15 @@ package org.apache.openwhisk.core.loadBalancer -import akka.actor.ActorRef -import akka.actor.ActorRefFactory +import org.apache.pekko.actor.ActorRef +import org.apache.pekko.actor.ActorRefFactory import java.util.concurrent.ThreadLocalRandom -import akka.actor.{Actor, ActorSystem, Cancellable, Props} -import akka.cluster.ClusterEvent._ -import akka.cluster.{Cluster, Member, MemberStatus} -import akka.management.scaladsl.AkkaManagement -import akka.management.cluster.bootstrap.ClusterBootstrap +import org.apache.pekko.actor.{Actor, ActorSystem, Cancellable, Props} +import org.apache.pekko.cluster.ClusterEvent._ +import org.apache.pekko.cluster.{Cluster, Member, MemberStatus} +import org.apache.pekko.management.scaladsl.PekkoManagement +import org.apache.pekko.management.cluster.bootstrap.ClusterBootstrap import org.apache.openwhisk.common.InvokerState.{Healthy, Offline, Unhealthy, Unresponsive} import pureconfig._ import pureconfig.generic.auto._ @@ -155,10 +155,10 @@ class ShardingContainerPoolBalancer( /** Build a cluster of all loadbalancers */ private val cluster: Option[Cluster] = if (loadConfigOrThrow[ClusterConfig](ConfigKeys.cluster).useClusterBootstrap) { - AkkaManagement(actorSystem).start() + PekkoManagement(actorSystem).start() ClusterBootstrap(actorSystem).start() Some(Cluster(actorSystem)) - } else if (loadConfigOrThrow[Seq[String]]("akka.cluster.seed-nodes").nonEmpty) { + } else if (loadConfigOrThrow[Seq[String]]("pekko.cluster.seed-nodes").nonEmpty) { Some(Cluster(actorSystem)) } else { None diff --git a/core/cosmosdb/cache-invalidator/build.gradle b/core/cosmosdb/cache-invalidator/build.gradle index 5fe4c8304eb..c1f6a9b4cd1 100644 --- a/core/cosmosdb/cache-invalidator/build.gradle +++ b/core/cosmosdb/cache-invalidator/build.gradle @@ -40,7 +40,7 @@ dependencies { exclude group: 'com.microsoft.azure', module:'azure-cosmosdb' } implementation "com.microsoft.azure:azure-cosmos:3.7.6" - implementation "com.typesafe.akka:akka-stream-kafka_${gradle.scala.depVersion}:${gradle.akka_kafka.version}" + implementation "org.apache.pekko:pekko-connectors-kafka_${gradle.scala.depVersion}:${gradle.pekko_kafka.version}" } mainClassName = "org.apache.openwhisk.core.database.cosmosdb.cache.Main" diff --git a/core/cosmosdb/cache-invalidator/src/main/resources/application.conf b/core/cosmosdb/cache-invalidator/src/main/resources/application.conf index 2a698f0a7f4..59a3418c76e 100644 --- a/core/cosmosdb/cache-invalidator/src/main/resources/application.conf +++ b/core/cosmosdb/cache-invalidator/src/main/resources/application.conf @@ -15,7 +15,7 @@ # limitations under the License. # -akka.kafka.producer { +pekko.kafka.producer { # Properties defined by org.apache.kafka.clients.consumer.ConsumerConfig # can be defined in this configuration section. kafka-clients { diff --git a/core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/CacheInvalidator.scala b/core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/CacheInvalidator.scala index c698a12d506..59acba161c4 100644 --- a/core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/CacheInvalidator.scala +++ b/core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/CacheInvalidator.scala @@ -16,9 +16,9 @@ */ package org.apache.openwhisk.core.database.cosmosdb.cache -import akka.Done -import akka.actor.{ActorSystem, CoordinatedShutdown} -import akka.kafka.ProducerSettings +import org.apache.pekko.Done +import org.apache.pekko.actor.{ActorSystem, CoordinatedShutdown} +import org.apache.pekko.kafka.ProducerSettings import com.typesafe.config.Config import org.apache.kafka.common.serialization.StringSerializer import org.apache.openwhisk.common.Logging @@ -107,6 +107,6 @@ object CacheInvalidator { def kafkaProducerSettings(config: Config): ProducerSettings[String, String] = ProducerSettings(config, new StringSerializer, new StringSerializer) - def defaultProducerConfig(globalConfig: Config): Config = globalConfig.getConfig("akka.kafka.producer") + def defaultProducerConfig(globalConfig: Config): Config = globalConfig.getConfig("pekko.kafka.producer") } diff --git a/core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/ChangeFeedConsumer.scala b/core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/ChangeFeedConsumer.scala index 0472bc509a0..1b9325d5784 100644 --- a/core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/ChangeFeedConsumer.scala +++ b/core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/ChangeFeedConsumer.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.core.database.cosmosdb.cache import java.util -import akka.Done +import org.apache.pekko.Done import com.azure.data.cosmos.internal.changefeed.implementation.ChangeFeedProcessorBuilderImpl import com.azure.data.cosmos.internal.changefeed.{ChangeFeedObserverCloseReason, ChangeFeedObserverContext} import com.azure.data.cosmos.{ diff --git a/core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/KafkaEventProducer.scala b/core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/KafkaEventProducer.scala index 07712760c5c..7cfb4bff925 100644 --- a/core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/KafkaEventProducer.scala +++ b/core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/KafkaEventProducer.scala @@ -17,12 +17,12 @@ package org.apache.openwhisk.core.database.cosmosdb.cache -import akka.Done -import akka.actor.ActorSystem -import akka.kafka.scaladsl.Producer -import akka.kafka.{ProducerMessage, ProducerSettings} -import akka.stream.scaladsl.{Keep, Sink, Source} -import akka.stream._ +import org.apache.pekko.Done +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.kafka.scaladsl.Producer +import org.apache.pekko.kafka.{ProducerMessage, ProducerSettings} +import org.apache.pekko.stream.scaladsl.{Keep, Sink, Source} +import org.apache.pekko.stream._ import org.apache.kafka.clients.consumer.ConsumerConfig import org.apache.kafka.clients.producer.ProducerRecord import org.apache.openwhisk.common.Logging diff --git a/core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/Main.scala b/core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/Main.scala index 81a4a3ef4aa..c589bdeb813 100644 --- a/core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/Main.scala +++ b/core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/Main.scala @@ -17,9 +17,9 @@ package org.apache.openwhisk.core.database.cosmosdb.cache -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import kamon.Kamon -import org.apache.openwhisk.common.{AkkaLogging, ConfigMXBean, Logging} +import org.apache.openwhisk.common.{ConfigMXBean, Logging, PekkoLogging} import org.apache.openwhisk.http.{BasicHttpService, BasicRasService} import scala.concurrent.ExecutionContext @@ -27,7 +27,7 @@ import scala.concurrent.ExecutionContext object Main { def main(args: Array[String]): Unit = { implicit val system: ActorSystem = ActorSystem("cache-invalidator-actor-system") - implicit val log: Logging = new AkkaLogging(akka.event.Logging.getLogger(system, this)) + implicit val log: Logging = new PekkoLogging(org.apache.pekko.event.Logging.getLogger(system, this)) implicit val ec: ExecutionContext = system.dispatcher ConfigMXBean.register() Kamon.init() diff --git a/core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/WhiskChangeEventObserver.scala b/core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/WhiskChangeEventObserver.scala index 5c8b40413ca..f770672e156 100644 --- a/core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/WhiskChangeEventObserver.scala +++ b/core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/WhiskChangeEventObserver.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.database.cosmosdb.cache -import akka.Done +import org.apache.pekko.Done import com.azure.data.cosmos.CosmosItemProperties import com.azure.data.cosmos.internal.changefeed.ChangeFeedObserverContext import com.google.common.base.Throwables diff --git a/core/invoker/src/main/resources/application.conf b/core/invoker/src/main/resources/application.conf index 4b2127a51da..ad0414a4848 100644 --- a/core/invoker/src/main/resources/application.conf +++ b/core/invoker/src/main/resources/application.conf @@ -17,7 +17,7 @@ # common logging configuration see common scala include "logging" -include "akka-http-version" +include "pekko-http-version" whisk { blacklist { @@ -62,7 +62,7 @@ whisk { container-pool { user-memory: 1024 m concurrent-peek-factor: 0.5 #factor used to limit message peeking: 0 < factor <= 1.0 - larger number improves concurrent processing, but increases risk of message loss during invoker crash - akka-client: false # if true, use PoolingContainerClient for HTTP from invoker to action container (otherwise use ApacheBlockingContainerClient) + pekko-client: false # if true, use PoolingContainerClient for HTTP from invoker to action container (otherwise use ApacheBlockingContainerClient) prewarm-expiration-check-init-delay: 10 minute # the init delay time for the first check prewarm-expiration-check-interval: 10 minute # period to check for prewarm expiration prewarm-expiration-check-interval-variance: 10 seconds # varies expiration across invokers to avoid many concurrent expirations diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerPool.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerPool.scala index 3c2ebd9c42d..6de6dc09e82 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerPool.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerPool.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.containerpool -import akka.actor.{Actor, ActorRef, ActorRefFactory, Props} +import org.apache.pekko.actor.{Actor, ActorRef, ActorRefFactory, Props} import org.apache.openwhisk.common.{Logging, LoggingMarkers, MetricEmitter, TransactionId} import org.apache.openwhisk.core.connector.MessageFeed import org.apache.openwhisk.core.entity.ExecManifest.ReactivePrewarmingConfig @@ -110,7 +110,7 @@ class ContainerPool(childFactory: ActorRefFactory => ActorRef, this, LoggingMarkers.INVOKER_CONTAINER_START(containerState, namespaceName, actionNamespace, actionName), s"containerStart containerState: $containerState container: $container activations: $activeActivations of max $maxConcurrent action: $actionName namespace: $namespaceName activationId: $activationId", - akka.event.Logging.InfoLevel) + org.apache.pekko.event.Logging.InfoLevel) } def receive: Receive = { diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala index 8261d49da2f..eedda09e780 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala @@ -17,21 +17,21 @@ package org.apache.openwhisk.core.containerpool -import akka.actor.Actor -import akka.actor.ActorRef -import akka.actor.Cancellable +import org.apache.pekko.actor.Actor +import org.apache.pekko.actor.ActorRef +import org.apache.pekko.actor.Cancellable import java.time.Instant -import akka.actor.Status.{Failure => FailureMessage} -import akka.actor.{FSM, Props, Stash} -import akka.event.Logging.InfoLevel -import akka.io.IO -import akka.io.Tcp -import akka.io.Tcp.Close -import akka.io.Tcp.CommandFailed -import akka.io.Tcp.Connect -import akka.io.Tcp.Connected -import akka.pattern.pipe +import org.apache.pekko.actor.Status.{Failure => FailureMessage} +import org.apache.pekko.actor.{FSM, Props, Stash} +import org.apache.pekko.event.Logging.InfoLevel +import org.apache.pekko.io.IO +import org.apache.pekko.io.Tcp +import org.apache.pekko.io.Tcp.Close +import org.apache.pekko.io.Tcp.CommandFailed +import org.apache.pekko.io.Tcp.Connect +import org.apache.pekko.io.Tcp.Connected +import org.apache.pekko.pattern.pipe import pureconfig.loadConfigOrThrow import pureconfig.generic.auto._ import java.net.InetSocketAddress @@ -43,7 +43,7 @@ import org.apache.openwhisk.common.TransactionId.systemPrefix import scala.collection.immutable import spray.json.DefaultJsonProtocol._ import spray.json._ -import org.apache.openwhisk.common.{AkkaLogging, Counter, LoggingMarkers, TransactionId} +import org.apache.openwhisk.common.{Counter, LoggingMarkers, PekkoLogging, TransactionId} import org.apache.openwhisk.core.ConfigKeys import org.apache.openwhisk.core.ack.ActiveAck import org.apache.openwhisk.core.connector.{ @@ -265,7 +265,7 @@ class ContainerProxy(factory: (TransactionId, extends FSM[ContainerState, ContainerData] with Stash { implicit val ec = context.system.dispatcher - implicit val logging = new AkkaLogging(context.system.log) + implicit val logging = new PekkoLogging(context.system.log) implicit val ac = context.system var rescheduleJob = false // true iff actor receives a job but cannot process it because actor will destroy itself var runBuffer = immutable.Queue.empty[Run] //does not retain order, but does manage jobs that would have pushed past action concurrency limit @@ -1124,7 +1124,7 @@ class TCPPingClient(tcp: ActorRef, remote: InetSocketAddress, config: ContainerProxyHealthCheckConfig) extends Actor { - implicit val logging = new AkkaLogging(context.system.log) + implicit val logging = new PekkoLogging(context.system.log) implicit val ec = context.system.dispatcher implicit var healthPingTx = TransactionId.actionHealthPing case object HealthPingSend diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerCliLogStore.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerCliLogStore.scala index d53ebfb1e04..4871f67c6d8 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerCliLogStore.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerCliLogStore.scala @@ -19,8 +19,8 @@ package org.apache.openwhisk.core.containerpool.docker import java.time.Instant -import akka.actor.ActorSystem -import org.apache.openwhisk.common.{AkkaLogging, Logging, TransactionId} +import org.apache.pekko.actor.ActorSystem +import org.apache.openwhisk.common.{Logging, PekkoLogging, TransactionId} import org.apache.openwhisk.core.containerpool.Container.ACTIVATION_LOG_SENTINEL import org.apache.openwhisk.core.containerpool.logging.{DockerToActivationLogStore, LogStore, LogStoreProvider} import org.apache.openwhisk.core.containerpool.{Container, ContainerId} @@ -36,7 +36,7 @@ import scala.concurrent.{ExecutionContext, Future} object DockerCliLogStoreProvider extends LogStoreProvider { override def instance(actorSystem: ActorSystem): LogStore = { //Logger is currently not passed implicitly to LogStoreProvider. So create one explicitly - implicit val logger = new AkkaLogging(akka.event.Logging.getLogger(actorSystem, this)) + implicit val logger = new PekkoLogging(org.apache.pekko.event.Logging.getLogger(actorSystem, this)) new DockerCliLogStore(actorSystem) } } diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerClient.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerClient.scala index 2494a9b3512..bad52c10024 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerClient.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerClient.scala @@ -22,7 +22,7 @@ import java.nio.file.Files import java.nio.file.Paths import java.util.concurrent.Semaphore -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import scala.collection.concurrent.TrieMap import scala.concurrent.blocking @@ -31,7 +31,7 @@ import scala.concurrent.{Await, Future} import scala.util.Failure import scala.util.Success import scala.util.Try -import akka.event.Logging.{ErrorLevel, InfoLevel} +import org.apache.pekko.event.Logging.{ErrorLevel, InfoLevel} import pureconfig._ import pureconfig.generic.auto._ import org.apache.openwhisk.common.{Logging, LoggingMarkers, TransactionId} diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerClientWithFileAccess.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerClientWithFileAccess.scala index 76c03cdb1d9..be26af13e76 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerClientWithFileAccess.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerClientWithFileAccess.scala @@ -20,10 +20,10 @@ package org.apache.openwhisk.core.containerpool.docker import java.io.File import java.nio.file.Paths -import akka.actor.ActorSystem -import akka.stream.alpakka.file.scaladsl.FileTailSource -import akka.stream.scaladsl.{FileIO, Source => AkkaSource} -import akka.util.ByteString +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream.connectors.file.scaladsl.FileTailSource +import org.apache.pekko.stream.scaladsl.{FileIO, Source => PekkoSource} +import org.apache.pekko.util.ByteString import scala.concurrent.ExecutionContext import scala.concurrent.Future @@ -143,7 +143,7 @@ class DockerClientWithFileAccess(dockerHost: Option[String] = None, private val readChunkSize = 8192 // bytes override def rawContainerLogs(containerId: ContainerId, fromPos: Long, - pollInterval: Option[FiniteDuration]): AkkaSource[ByteString, Any] = + pollInterval: Option[FiniteDuration]): PekkoSource[ByteString, Any] = try { // If there is no waiting interval, we can end the stream early by reading just what is there from file. pollInterval match { @@ -151,7 +151,7 @@ class DockerClientWithFileAccess(dockerHost: Option[String] = None, case None => FileIO.fromPath(containerLogFile(containerId).toPath, readChunkSize, fromPos) } } catch { - case t: Throwable => AkkaSource.failed(t) + case t: Throwable => PekkoSource.failed(t) } } @@ -168,5 +168,5 @@ trait DockerApiWithFileAccess extends DockerApi { */ def rawContainerLogs(containerId: ContainerId, fromPos: Long, - pollInterval: Option[FiniteDuration]): AkkaSource[ByteString, Any] + pollInterval: Option[FiniteDuration]): PekkoSource[ByteString, Any] } diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerContainer.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerContainer.scala index f0dd13c82ca..098c85772e5 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerContainer.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerContainer.scala @@ -20,9 +20,9 @@ package org.apache.openwhisk.core.containerpool.docker import java.time.Instant import java.util.concurrent.TimeoutException import java.util.concurrent.atomic.AtomicLong -import akka.actor.ActorSystem -import akka.stream._ -import akka.stream.scaladsl.Framing.FramingException +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream._ +import org.apache.pekko.stream.scaladsl.Framing.FramingException import spray.json._ import scala.concurrent.{ExecutionContext, Future} import scala.concurrent.duration._ @@ -32,9 +32,9 @@ import org.apache.openwhisk.core.containerpool._ import org.apache.openwhisk.core.entity.ActivationResponse.{ConnectionError, MemoryExhausted} import org.apache.openwhisk.core.entity.ByteSize import org.apache.openwhisk.core.entity.size._ -import akka.stream.scaladsl.{Framing, Source} -import akka.stream.stage._ -import akka.util.ByteString +import org.apache.pekko.stream.scaladsl.{Framing, Source} +import org.apache.pekko.stream.stage._ +import org.apache.pekko.util.ByteString import spray.json._ import org.apache.openwhisk.core.containerpool.logging.LogLine import org.apache.openwhisk.core.entity.ExecManifest.ImageName @@ -210,7 +210,7 @@ class DockerContainer(protected val id: ContainerId, implicit transid: TransactionId): Future[Boolean] = { docker.isOomKilled(id)(TransactionId.invoker).flatMap { killed => if (killed) Future.successful(true) - else if (retries > 0) akka.pattern.after(filePollInterval, as.scheduler)(isOomKilled(retries - 1)) + else if (retries > 0) org.apache.pekko.pattern.after(filePollInterval, as.scheduler)(isOomKilled(retries - 1)) else Future.successful(false) } } @@ -226,8 +226,8 @@ class DockerContainer(protected val id: ContainerId, reschedule: Boolean = false)(implicit transid: TransactionId): Future[RunResult] = { val started = Instant.now() val http = httpConnection.getOrElse { - val conn = if (Container.config.akkaClient) { - new AkkaContainerClient(addr.host, addr.port, timeout, 1024) + val conn = if (Container.config.pekkoClient) { + new PekkoContainerClient(addr.host, addr.port, timeout, 1024) } else { new ApacheBlockingContainerClient(s"${addr.host}:${addr.port}", timeout, maxConcurrent) } diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerContainerFactory.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerContainerFactory.scala index c4e1f8effb7..3eefad79ee8 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerContainerFactory.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerContainerFactory.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.containerpool.docker -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import scala.concurrent.Await import scala.concurrent.ExecutionContext diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerForMacContainerFactory.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerForMacContainerFactory.scala index 97d265c43a0..39cbda53b95 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerForMacContainerFactory.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerForMacContainerFactory.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.containerpool.docker -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.core.WhiskConfig import org.apache.openwhisk.core.containerpool._ diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/ProcessRunner.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/ProcessRunner.scala index 4b16d60c47c..8a7646970bd 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/ProcessRunner.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/ProcessRunner.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.containerpool.docker -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import scala.collection.mutable import scala.concurrent.ExecutionContext diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/RuncClient.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/RuncClient.scala index 54f393cb638..b5f7b0ea2bd 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/RuncClient.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/RuncClient.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.containerpool.docker -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import scala.concurrent.Future import scala.concurrent.ExecutionContext @@ -30,7 +30,7 @@ import org.apache.openwhisk.common.Logging import org.apache.openwhisk.core.ConfigKeys import pureconfig._ import pureconfig.generic.auto._ -import akka.event.Logging.{ErrorLevel, InfoLevel} +import org.apache.pekko.event.Logging.{ErrorLevel, InfoLevel} import org.apache.openwhisk.core.containerpool.ContainerId import scala.concurrent.duration.Duration diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/StandaloneDockerContainerFactory.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/StandaloneDockerContainerFactory.scala index 0251da7fe52..08503334310 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/StandaloneDockerContainerFactory.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/StandaloneDockerContainerFactory.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.containerpool.docker -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import org.apache.commons.lang3.SystemUtils import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.core.{ConfigKeys, WhiskConfig} diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/kubernetes/KubernetesClient.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/kubernetes/KubernetesClient.scala index 1e878c19f41..65c0a045379 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/kubernetes/KubernetesClient.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/kubernetes/KubernetesClient.scala @@ -22,16 +22,16 @@ import java.net.SocketTimeoutException import java.time.format.DateTimeFormatterBuilder import java.time.temporal.ChronoField import java.time.{Instant, ZoneId} -import akka.actor.ActorSystem -import akka.event.Logging.ErrorLevel -import akka.event.Logging.InfoLevel -import akka.http.scaladsl.model.Uri -import akka.http.scaladsl.model.Uri.{Path, Query} -import akka.pattern.after -import akka.stream.scaladsl.Source -import akka.stream.stage._ -import akka.stream.{Attributes, Outlet, SourceShape} -import akka.util.ByteString +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.event.Logging.ErrorLevel +import org.apache.pekko.event.Logging.InfoLevel +import org.apache.pekko.http.scaladsl.model.Uri +import org.apache.pekko.http.scaladsl.model.Uri.{Path, Query} +import org.apache.pekko.pattern.after +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.stream.stage._ +import org.apache.pekko.stream.{Attributes, Outlet, SourceShape} +import org.apache.pekko.util.ByteString import collection.JavaConverters._ import io.fabric8.kubernetes.api.model._ @@ -161,7 +161,7 @@ class KubernetesClient( this, LoggingMarkers.INVOKER_KUBEAPI_CMD("create"), s"launching pod $name (image:$image, mem: ${memory.toMB}) (timeout: ${config.timeouts.run.toSeconds}s)", - logLevel = akka.event.Logging.InfoLevel) + logLevel = org.apache.pekko.event.Logging.InfoLevel) //create the pod; catch any failure to end the transaction timer Try { @@ -231,7 +231,7 @@ class KubernetesClient( this, LoggingMarkers.INVOKER_KUBEAPI_CMD("delete"), s"Deleting pods with label $labels", - logLevel = akka.event.Logging.InfoLevel) + logLevel = org.apache.pekko.event.Logging.InfoLevel) Future { blocking { kubeRestClient @@ -262,7 +262,7 @@ class KubernetesClient( this, LoggingMarkers.INVOKER_KUBEAPI_CMD("delete"), s"Deleting pod ${podName}", - logLevel = akka.event.Logging.InfoLevel) + logLevel = org.apache.pekko.event.Logging.InfoLevel) Future { blocking { kubeRestClient diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/kubernetes/KubernetesContainer.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/kubernetes/KubernetesContainer.scala index 51b4c87a257..627313e81ae 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/kubernetes/KubernetesContainer.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/kubernetes/KubernetesContainer.scala @@ -17,14 +17,14 @@ package org.apache.openwhisk.core.containerpool.kubernetes -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import java.time.Instant import java.util.concurrent.atomic.AtomicReference -import akka.stream.StreamLimitReachedException -import akka.stream.scaladsl.Framing.FramingException -import akka.stream.scaladsl.Source -import akka.util.ByteString +import org.apache.pekko.stream.StreamLimitReachedException +import org.apache.pekko.stream.scaladsl.Framing.FramingException +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.util.ByteString import io.fabric8.kubernetes.client.PortForward import scala.concurrent.ExecutionContext diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/kubernetes/KubernetesContainerFactory.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/kubernetes/KubernetesContainerFactory.scala index d627627d502..913ea348557 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/kubernetes/KubernetesContainerFactory.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/kubernetes/KubernetesContainerFactory.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.containerpool.kubernetes -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import pureconfig._ import pureconfig.generic.auto._ diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/ActivationClientProxy.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/ActivationClientProxy.scala index dc38e10b829..fb86a76964d 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/ActivationClientProxy.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/ActivationClientProxy.scala @@ -17,10 +17,10 @@ package org.apache.openwhisk.core.containerpool.v2 -import akka.actor.Status.{Failure => FailureMessage} -import akka.actor.{ActorSystem, FSM, Props, Stash} -import akka.grpc.internal.ClientClosedException -import akka.pattern.pipe +import org.apache.pekko.actor.Status.{Failure => FailureMessage} +import org.apache.pekko.actor.{ActorSystem, FSM, Props, Stash} +import org.apache.pekko.grpc.internal.ClientClosedException +import org.apache.pekko.pattern.pipe import io.grpc.StatusRuntimeException import org.apache.openwhisk.common.{GracefulShutdown, Logging, TransactionId} import org.apache.openwhisk.core.connector.ActivationMessage @@ -198,14 +198,14 @@ class ActivationClientProxy( // In such situation, it is better to stop the activationClientProxy, otherwise, in short time, // it would print huge log due to create another grpcClient to fetch activation again. case t: StatusRuntimeException if t.getMessage.contains(ActivationClientProxy.hostResolveError) => - logging.error(this, s"[${containerId.asString}] akka grpc server connection failed: $t") + logging.error(this, s"[${containerId.asString}] pekko grpc server connection failed: $t") context.parent ! FailureMessage(t) self ! ClientClosed goto(ClientProxyRemoving) case t: StatusRuntimeException => - logging.error(this, s"[${containerId.asString}] akka grpc server connection failed: $t") + logging.error(this, s"[${containerId.asString}] pekko grpc server connection failed: $t") c.activationClient .close() .flatMap(_ => diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerPool.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerPool.scala index 7f9fc9b3e4d..8187f2444e1 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerPool.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerPool.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.core.containerpool.v2 import java.util.concurrent.atomic.AtomicInteger -import akka.actor.{Actor, ActorRef, ActorRefFactory, Cancellable, Props} +import org.apache.pekko.actor.{Actor, ActorRef, ActorRefFactory, Cancellable, Props} import org.apache.openwhisk.common._ import org.apache.openwhisk.core.connector.ContainerCreationError._ import org.apache.openwhisk.core.connector.{ diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerProxy.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerProxy.scala index b0fa73f35f3..fae6859f0ac 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerProxy.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerProxy.scala @@ -19,11 +19,11 @@ package org.apache.openwhisk.core.containerpool.v2 import java.net.InetSocketAddress import java.time.Instant -import akka.actor.Status.{Failure => FailureMessage} -import akka.actor.{actorRef2Scala, ActorRef, ActorRefFactory, ActorSystem, FSM, Props, Stash} -import akka.event.Logging.InfoLevel -import akka.io.{IO, Tcp} -import akka.pattern.pipe +import org.apache.pekko.actor.Status.{Failure => FailureMessage} +import org.apache.pekko.actor.{actorRef2Scala, ActorRef, ActorRefFactory, ActorSystem, FSM, Props, Stash} +import org.apache.pekko.event.Logging.InfoLevel +import org.apache.pekko.io.{IO, Tcp} +import org.apache.pekko.pattern.pipe import org.apache.openwhisk.common.tracing.WhiskTracerProvider import org.apache.openwhisk.common.{LoggingMarkers, TransactionId, _} import org.apache.openwhisk.core.ConfigKeys @@ -692,7 +692,7 @@ class FunctionPullingContainerProxy( "") parent ! Resumed(data) // the new queue may locates on an different scheduler, so recreate the activation client when necessary - // since akka port will no be used, we can put any value except 0 here + // since pekko port will no be used, we can put any value except 0 here data.clientProxy ! RequestActivation( newScheduler = Some(SchedulerEndpoints(job.schedulerHost, job.rpcPort, 10))) startSingleTimer(UnusedTimeoutName, StateTimeout, unusedTimeout) diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/InvokerHealthManager.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/InvokerHealthManager.scala index 3554e515d66..14a2eada244 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/InvokerHealthManager.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/InvokerHealthManager.scala @@ -17,9 +17,9 @@ package org.apache.openwhisk.core.containerpool.v2 -import akka.actor.Status.{Failure => FailureMessage} -import akka.actor.{Actor, ActorRef, ActorRefFactory, ActorSystem, FSM, Props, Stash} -import akka.util.Timeout +import org.apache.pekko.actor.Status.{Failure => FailureMessage} +import org.apache.pekko.actor.{Actor, ActorRef, ActorRefFactory, ActorSystem, FSM, Props, Stash} +import org.apache.pekko.util.Timeout import org.apache.openwhisk.common.InvokerState.{Healthy, Offline, Unhealthy} import org.apache.openwhisk.common._ import org.apache.openwhisk.core.connector._ @@ -129,7 +129,7 @@ class InvokerHealthManager(instanceId: InvokerInstanceId, this, LoggingMarkers.LOADBALANCER_INVOKER_STATUS_CHANGE(Unhealthy.asString), s"invoker${instanceId.toInt} is unhealthy", - akka.event.Logging.WarningLevel) + org.apache.pekko.event.Logging.WarningLevel) startTestAction(self) publishHealthStatusAndStay(Unhealthy, nextStateData) diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/ContainerMessageConsumer.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/ContainerMessageConsumer.scala index 416ce50f4d5..4119256e6e9 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/ContainerMessageConsumer.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/ContainerMessageConsumer.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.invoker -import akka.actor.{ActorRef, ActorSystem, Props} +import org.apache.pekko.actor.{ActorRef, ActorSystem, Props} import org.apache.openwhisk.common.{GracefulShutdown, Logging, TransactionId} import org.apache.openwhisk.core.WarmUp.isWarmUpAction import org.apache.openwhisk.core.WhiskConfig diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/DefaultInvokerServer.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/DefaultInvokerServer.scala index 1321d8add18..219c9a32014 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/DefaultInvokerServer.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/DefaultInvokerServer.scala @@ -17,10 +17,10 @@ package org.apache.openwhisk.core.invoker -import akka.actor.ActorSystem -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.model.headers.BasicHttpCredentials -import akka.http.scaladsl.server.Route +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.headers.BasicHttpCredentials +import org.apache.pekko.http.scaladsl.server.Route import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.core.ConfigKeys import org.apache.openwhisk.http.BasicRasService diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/FPCInvokerReactive.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/FPCInvokerReactive.scala index d8add53613b..ac587ddfcee 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/FPCInvokerReactive.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/FPCInvokerReactive.scala @@ -17,11 +17,11 @@ package org.apache.openwhisk.core.invoker -import akka.Done -import akka.actor.{ActorRef, ActorRefFactory, ActorSystem, CoordinatedShutdown, Props} -import akka.grpc.GrpcClientSettings -import akka.pattern.ask -import akka.util.Timeout +import org.apache.pekko.Done +import org.apache.pekko.actor.{ActorRef, ActorRefFactory, ActorSystem, CoordinatedShutdown, Props} +import org.apache.pekko.grpc.GrpcClientSettings +import org.apache.pekko.pattern.ask +import org.apache.pekko.util.Timeout import com.ibm.etcd.api.Event.EventType import com.ibm.etcd.client.kv.KvClient.Watch import com.ibm.etcd.client.kv.WatchUpdate diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/FPCInvokerServer.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/FPCInvokerServer.scala index 99909120956..5351aaccbd7 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/FPCInvokerServer.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/FPCInvokerServer.scala @@ -17,11 +17,11 @@ package org.apache.openwhisk.core.invoker -import akka.actor.ActorSystem -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.model.StatusCodes.OK -import akka.http.scaladsl.model.headers.BasicHttpCredentials -import akka.http.scaladsl.server.Route +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.StatusCodes.OK +import org.apache.pekko.http.scaladsl.model.headers.BasicHttpCredentials +import org.apache.pekko.http.scaladsl.server.Route import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.core.ConfigKeys import org.apache.openwhisk.http.BasicRasService diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/Invoker.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/Invoker.scala index 1eeb65c16a8..7efaf643953 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/Invoker.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/Invoker.scala @@ -17,8 +17,8 @@ package org.apache.openwhisk.core.invoker -import akka.Done -import akka.actor.{ActorSystem, CoordinatedShutdown} +import org.apache.pekko.Done +import org.apache.pekko.actor.{ActorSystem, CoordinatedShutdown} import com.typesafe.config.ConfigValueFactory import kamon.Kamon import org.apache.openwhisk.common.Https.HttpsConfig @@ -107,7 +107,7 @@ object Invoker { implicit val ec = ExecutionContextFactory.makeCachedThreadPoolExecutionContext() implicit val actorSystem: ActorSystem = ActorSystem(name = "invoker-actor-system", defaultExecutionContext = Some(ec)) - implicit val logger = new AkkaLogging(akka.event.Logging.getLogger(actorSystem, this)) + implicit val logger = new PekkoLogging(org.apache.pekko.event.Logging.getLogger(actorSystem, this)) val poolConfig: ContainerPoolConfig = loadConfigOrThrow[ContainerPoolConfig](ConfigKeys.containerPool) val limitConfig: IntraConcurrencyLimitConfig = loadConfigOrThrow[IntraConcurrencyLimitConfig](ConfigKeys.concurrencyLimit) diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/InvokerReactive.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/InvokerReactive.scala index ab265d05114..a82b64f46c9 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/InvokerReactive.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/InvokerReactive.scala @@ -20,9 +20,9 @@ package org.apache.openwhisk.core.invoker import java.nio.charset.StandardCharsets import java.time.Instant -import akka.Done -import akka.actor.{ActorRef, ActorRefFactory, ActorSystem, CoordinatedShutdown, Props} -import akka.event.Logging.InfoLevel +import org.apache.pekko.Done +import org.apache.pekko.actor.{ActorRef, ActorRefFactory, ActorSystem, CoordinatedShutdown, Props} +import org.apache.pekko.event.Logging.InfoLevel import org.apache.openwhisk.common._ import org.apache.openwhisk.common.tracing.WhiskTracerProvider import org.apache.openwhisk.core.ack.{MessagingActiveAck, UserEventSender} diff --git a/core/monitoring/user-events/build.gradle b/core/monitoring/user-events/build.gradle index f771e25aa91..3850c668f63 100644 --- a/core/monitoring/user-events/build.gradle +++ b/core/monitoring/user-events/build.gradle @@ -38,24 +38,28 @@ dependencies { implementation "org.scala-lang:scala-library:${gradle.scala.version}" implementation project(':common:scala') - implementation "com.typesafe.akka:akka-stream-kafka_${gradle.scala.depVersion}:${gradle.akka_kafka.version}" + implementation "org.apache.pekko:pekko-connectors-kafka_${gradle.scala.depVersion}:${gradle.pekko_kafka.version}" implementation "io.prometheus:simpleclient:0.6.0" implementation "io.prometheus:simpleclient_common:0.6.0" testImplementation "junit:junit:4.11" - testImplementation "org.scalatest:scalatest_${gradle.scala.depVersion}:3.0.8" - testImplementation "io.github.embeddedkafka:embedded-kafka_${gradle.scala.depVersion}:2.8.1" + testImplementation "org.scalatest:scalatest_${gradle.scala.depVersion}:3.2.14" + testImplementation "org.scalatestplus:junit-4-13_${gradle.scala.depVersion}:3.2.14.0" + testImplementation "io.github.embeddedkafka:embedded-kafka_${gradle.scala.depVersion}:3.9.1" constraints { - testImplementation("io.github.embeddedkafka:embedded-kafka_${gradle.scala.depVersion}:2.8.1") - testImplementation('org.apache.avro:avro:1.11.1') { - because 'embeddedkafka dependency cannot be upgraded currently and avro in embedded kafka 2.4.0 has vulns' - } + testImplementation("io.github.embeddedkafka:embedded-kafka_${gradle.scala.depVersion}:3.9.1") + testImplementation("org.apache.kafka:kafka-clients:3.9.1") + } + testImplementation ("org.apache.zookeeper:zookeeper:3.9.3") { + exclude group: 'org.slf4j' + exclude group: 'log4j' + exclude group: 'jline' } - testImplementation "com.typesafe.akka:akka-stream-kafka-testkit_${gradle.scala.depVersion}:${gradle.akka_kafka.version}" - testImplementation "com.typesafe.akka:akka-testkit_${gradle.scala.depVersion}:${gradle.akka.version}" - testImplementation "com.typesafe.akka:akka-stream-testkit_${gradle.scala.depVersion}:${gradle.akka.version}" - testImplementation "com.typesafe.akka:akka-http-testkit_${gradle.scala.depVersion}:${gradle.akka_http.version}" + testImplementation "org.apache.pekko:pekko-connectors-kafka-testkit_${gradle.scala.depVersion}:${gradle.pekko_kafka.version}" + testImplementation "org.apache.pekko:pekko-testkit_${gradle.scala.depVersion}:${gradle.pekko.version}" + testImplementation "org.apache.pekko:pekko-stream-testkit_${gradle.scala.depVersion}:${gradle.pekko.version}" + testImplementation "org.apache.pekko:pekko-http-testkit_${gradle.scala.depVersion}:${gradle.pekko_http.version}" } mainClassName = "org.apache.openwhisk.core.monitoring.metrics.Main" diff --git a/core/monitoring/user-events/src/main/resources/application.conf b/core/monitoring/user-events/src/main/resources/application.conf index 9e6f0d6c23a..372f58d6341 100644 --- a/core/monitoring/user-events/src/main/resources/application.conf +++ b/core/monitoring/user-events/src/main/resources/application.conf @@ -15,13 +15,13 @@ # limitations under the License. # -akka.kafka.committer { +pekko.kafka.committer { max-batch = 20 } -akka.kafka.consumer { +pekko.kafka.consumer { # Properties defined by org.apache.kafka.clients.consumer.ConsumerConfig # can be defined in this configuration section. kafka-clients { @@ -41,7 +41,7 @@ kamon { tick-interval = 15 seconds } prometheus { - # We expose the metrics endpoint over akka http. So default server is disabled + # We expose the metrics endpoint over pekko http. So default server is disabled start-embedded-http-server = no } diff --git a/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/EventConsumer.scala b/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/EventConsumer.scala index d34be02f881..45d895affbf 100644 --- a/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/EventConsumer.scala +++ b/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/EventConsumer.scala @@ -20,12 +20,12 @@ package org.apache.openwhisk.core.monitoring.metrics import java.lang.management.ManagementFactory import java.util.concurrent.atomic.AtomicReference -import akka.Done -import akka.actor.ActorSystem -import akka.kafka.scaladsl.{Committer, Consumer} -import akka.kafka.{CommitterSettings, ConsumerSettings, Subscriptions} -import akka.stream.RestartSettings -import akka.stream.scaladsl.{RestartSource, Sink} +import org.apache.pekko.Done +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.kafka.scaladsl.{Committer, Consumer} +import org.apache.pekko.kafka.{CommitterSettings, ConsumerSettings, Subscriptions} +import org.apache.pekko.stream.RestartSettings +import org.apache.pekko.stream.scaladsl.{RestartSource, Sink} import javax.management.ObjectName import org.apache.kafka.clients.consumer.ConsumerConfig import kamon.Kamon @@ -163,7 +163,7 @@ case class EventConsumer(settings: ConsumerSettings[String, String], settings .withProperty(ConsumerConfig.CLIENT_ID_CONFIG, id) .withProperty(ConsumerConfig.METRIC_REPORTER_CLASSES_CONFIG, KamonMetricsReporter.name) - .withStopTimeout(Duration.Zero) // https://doc.akka.io/docs/alpakka-kafka/current/consumer.html#draining-control + .withStopTimeout(Duration.Zero) // https://pekko.apache.org/api/pekko-connectors-kafka/current/org/apache/pekko/kafka/scaladsl/Consumer$$DrainingControl$.html } object EventConsumer { diff --git a/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/KamonRecorder.scala b/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/KamonRecorder.scala index 3ee829ebb05..b0c94df3ed7 100644 --- a/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/KamonRecorder.scala +++ b/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/KamonRecorder.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.monitoring.metrics -import akka.event.slf4j.SLF4JLogging +import org.apache.pekko.event.slf4j.SLF4JLogging import org.apache.openwhisk.core.connector.{Activation, Metric} import kamon.Kamon import kamon.metric.MeasurementUnit diff --git a/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/Main.scala b/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/Main.scala index 231e5eab555..ee29d415069 100644 --- a/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/Main.scala +++ b/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/Main.scala @@ -17,8 +17,8 @@ package org.apache.openwhisk.core.monitoring.metrics -import akka.actor.ActorSystem -import akka.http.scaladsl.Http +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.Http import kamon.Kamon import scala.concurrent.duration.DurationInt diff --git a/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/OpenWhiskEvents.scala b/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/OpenWhiskEvents.scala index abdb7c43b6f..11008018a18 100644 --- a/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/OpenWhiskEvents.scala +++ b/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/OpenWhiskEvents.scala @@ -17,10 +17,10 @@ package org.apache.openwhisk.core.monitoring.metrics -import akka.actor.{ActorSystem, CoordinatedShutdown} -import akka.event.slf4j.SLF4JLogging -import akka.http.scaladsl.Http -import akka.kafka.ConsumerSettings +import org.apache.pekko.actor.{ActorSystem, CoordinatedShutdown} +import org.apache.pekko.event.slf4j.SLF4JLogging +import org.apache.pekko.http.scaladsl.Http +import org.apache.pekko.kafka.ConsumerSettings import com.typesafe.config.Config import kamon.Kamon import kamon.prometheus.PrometheusReporter @@ -67,5 +67,5 @@ object OpenWhiskEvents extends SLF4JLogging { def eventConsumerSettings(config: Config): ConsumerSettings[String, String] = ConsumerSettings(config, new StringDeserializer, new StringDeserializer) - def defaultConsumerConfig(globalConfig: Config): Config = globalConfig.getConfig("akka.kafka.consumer") + def defaultConsumerConfig(globalConfig: Config): Config = globalConfig.getConfig("pekko.kafka.consumer") } diff --git a/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/PrometheusEventsApi.scala b/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/PrometheusEventsApi.scala index 2c2a5f4f6d2..8634cff7b62 100644 --- a/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/PrometheusEventsApi.scala +++ b/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/PrometheusEventsApi.scala @@ -17,10 +17,10 @@ package org.apache.openwhisk.core.monitoring.metrics -import akka.http.scaladsl.model.StatusCodes.ServiceUnavailable -import akka.http.scaladsl.model.{ContentType, HttpCharsets, MediaType, MessageEntity} -import akka.http.scaladsl.server.Directives._ -import akka.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.model.StatusCodes.ServiceUnavailable +import org.apache.pekko.http.scaladsl.model.{ContentType, HttpCharsets, MediaType, MessageEntity} +import org.apache.pekko.http.scaladsl.server.Directives._ +import org.apache.pekko.http.scaladsl.server.Route import org.apache.openwhisk.connector.kafka.KafkaMetricRoute import scala.concurrent.ExecutionContext diff --git a/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/PrometheusRecorder.scala b/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/PrometheusRecorder.scala index ff7cb9c79ef..ea2d9ddf6cc 100644 --- a/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/PrometheusRecorder.scala +++ b/core/monitoring/user-events/src/main/scala/org/apache/openwhisk/core/monitoring/metrics/PrometheusRecorder.scala @@ -21,10 +21,10 @@ import java.io.StringWriter import java.util import java.util.concurrent.TimeUnit -import akka.event.slf4j.SLF4JLogging -import akka.http.scaladsl.model.{HttpEntity, MessageEntity} -import akka.stream.scaladsl.{Concat, Source} -import akka.util.ByteString +import org.apache.pekko.event.slf4j.SLF4JLogging +import org.apache.pekko.http.scaladsl.model.{HttpEntity, MessageEntity} +import org.apache.pekko.stream.scaladsl.{Concat, Source} +import org.apache.pekko.util.ByteString import io.prometheus.client.exporter.common.TextFormat import io.prometheus.client.{CollectorRegistry, Counter, Gauge, Histogram} import kamon.prometheus.PrometheusReporter diff --git a/core/monitoring/user-events/src/test/resources/logback-test.xml b/core/monitoring/user-events/src/test/resources/logback-test.xml index b485a6e33a5..62b754c4ac5 100644 --- a/core/monitoring/user-events/src/test/resources/logback-test.xml +++ b/core/monitoring/user-events/src/test/resources/logback-test.xml @@ -35,7 +35,7 @@ - + diff --git a/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/ApiTests.scala b/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/ApiTests.scala index 1a75942b1e0..77dfd145050 100644 --- a/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/ApiTests.scala +++ b/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/ApiTests.scala @@ -17,17 +17,19 @@ package org.apache.openwhisk.core.monitoring.metrics -import akka.http.scaladsl.model.headers.HttpEncodings._ -import akka.http.scaladsl.model.headers.{`Accept-Encoding`, `Content-Encoding`, HttpEncoding, HttpEncodings} -import akka.http.scaladsl.model.{HttpCharsets, HttpEntity, HttpResponse} -import akka.http.scaladsl.testkit.ScalatestRouteTest +import org.apache.pekko.http.scaladsl.model.headers.HttpEncodings._ +import org.apache.pekko.http.scaladsl.model.headers.{`Accept-Encoding`, `Content-Encoding`, HttpEncoding, HttpEncodings} +import org.apache.pekko.http.scaladsl.model.{HttpCharsets, HttpEntity, HttpResponse} +import org.apache.pekko.http.scaladsl.testkit.ScalatestRouteTest import kamon.prometheus.PrometheusReporter import org.apache.openwhisk.core.monitoring.metrics.OpenWhiskEvents.MetricConfig import org.junit.runner.RunWith import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import org.scalatest.matchers.Matcher -import org.scalatest.{BeforeAndAfterAll, FlatSpec, Matchers} +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import pureconfig.loadConfigOrThrow import io.prometheus.client.CollectorRegistry import pureconfig.generic.auto._ @@ -36,7 +38,7 @@ import scala.concurrent.duration.DurationInt @RunWith(classOf[JUnitRunner]) class ApiTests - extends FlatSpec + extends AnyFlatSpec with Matchers with ScalatestRouteTest with EventsTestHelper diff --git a/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/EventsTestHelper.scala b/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/EventsTestHelper.scala index 7c28799ba88..af90eb351d6 100644 --- a/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/EventsTestHelper.scala +++ b/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/EventsTestHelper.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.core.monitoring.metrics import java.net.ServerSocket -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import com.typesafe.config.Config import org.apache.openwhisk.core.monitoring.metrics.OpenWhiskEvents.MetricConfig import pureconfig._ diff --git a/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/KafkaSpecBase.scala b/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/KafkaSpecBase.scala index e9998b19f15..cc54e2b36c0 100644 --- a/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/KafkaSpecBase.scala +++ b/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/KafkaSpecBase.scala @@ -17,18 +17,20 @@ package org.apache.openwhisk.core.monitoring.metrics -import akka.kafka.testkit.scaladsl.ScalatestKafkaSpec +import org.apache.pekko.kafka.testkit.scaladsl.ScalatestKafkaSpec import io.github.embeddedkafka.{EmbeddedKafka, EmbeddedKafkaConfig} -import org.scalatest._ +import org.scalatest.Suite +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import org.scalatest.concurrent.{Eventually, IntegrationPatience, ScalaFutures} import scala.concurrent.duration.{DurationInt, FiniteDuration} abstract class KafkaSpecBase - extends ScalatestKafkaSpec(6065) + extends ScalatestKafkaSpec(0) with Matchers with ScalaFutures - with FlatSpecLike + with AnyFlatSpecLike with EmbeddedKafka with IntegrationPatience with Eventually @@ -38,7 +40,8 @@ abstract class KafkaSpecBase override protected val topicCreationTimeout = 60.seconds override protected val producerPublishTimeout: FiniteDuration = 60.seconds - lazy implicit val embeddedKafkaConfig: EmbeddedKafkaConfig = EmbeddedKafkaConfig(kafkaPort, zooKeeperPort) + implicit val embeddedKafkaConfig: EmbeddedKafkaConfig = + EmbeddedKafkaConfig(kafkaPort = freePort(), zooKeeperPort = freePort()) override def bootstrapServers = s"localhost:${embeddedKafkaConfig.kafkaPort}" diff --git a/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/KamonRecorderTests.scala b/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/KamonRecorderTests.scala index aabc9e65329..a3382e79262 100644 --- a/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/KamonRecorderTests.scala +++ b/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/KamonRecorderTests.scala @@ -28,7 +28,7 @@ import org.apache.openwhisk.core.connector.{Activation, EventMessage} import org.apache.openwhisk.core.entity.{ActivationId, ActivationResponse, Subject, UUID} import org.junit.runner.RunWith import org.scalatest.BeforeAndAfterEach -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import scala.concurrent.duration._ @@ -68,7 +68,7 @@ class KamonRecorderTests extends KafkaSpecBase with BeforeAndAfterEach with Kamo it should "push user events to kamon" in { createCustomTopic(EventConsumer.userEventTopic) - val consumer = createConsumer(kafkaPort, system.settings.config, KamonRecorder) + val consumer = createConsumer(embeddedKafkaConfig.kafkaPort, system.settings.config, KamonRecorder) publishStringMessageToKafka( EventConsumer.userEventTopic, diff --git a/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/OpenWhiskEventsTests.scala b/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/OpenWhiskEventsTests.scala index 769a0400722..12dca9cbe09 100644 --- a/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/OpenWhiskEventsTests.scala +++ b/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/OpenWhiskEventsTests.scala @@ -17,14 +17,14 @@ package org.apache.openwhisk.core.monitoring.metrics -import akka.http.scaladsl.Http -import akka.http.scaladsl.model.{HttpRequest, StatusCodes} -import akka.http.scaladsl.unmarshalling.Unmarshal +import org.apache.pekko.http.scaladsl.Http +import org.apache.pekko.http.scaladsl.model.{HttpRequest, StatusCodes} +import org.apache.pekko.http.scaladsl.unmarshalling.Unmarshal import com.typesafe.config.ConfigFactory import io.prometheus.client.CollectorRegistry import kamon.Kamon import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import scala.concurrent.duration._ import scala.util.Try @@ -37,8 +37,8 @@ class OpenWhiskEventsTests extends KafkaSpecBase { val httpPort = freePort() val globalConfig = system.settings.config val config = ConfigFactory.parseString(s""" - | akka.kafka.consumer.kafka-clients { - | bootstrap.servers = "localhost:$kafkaPort" + | pekko.kafka.consumer.kafka-clients { + | bootstrap.servers = "localhost:${embeddedKafkaConfig.kafkaPort}" | } | kamon { | metric { diff --git a/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/PrometheusRecorderTests.scala b/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/PrometheusRecorderTests.scala index 4f8e7f7a251..d58378e0f1e 100644 --- a/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/PrometheusRecorderTests.scala +++ b/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/PrometheusRecorderTests.scala @@ -25,7 +25,7 @@ import org.apache.openwhisk.core.entity.{ActivationId, ActivationResponse, Subje import org.apache.openwhisk.core.monitoring.metrics.OpenWhiskEvents.MetricConfig import org.junit.runner.RunWith import org.scalatest.BeforeAndAfterEach -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import pureconfig._ import pureconfig.generic.auto._ @@ -46,7 +46,7 @@ class PrometheusRecorderTests extends KafkaSpecBase with BeforeAndAfterEach with CollectorRegistry.defaultRegistry.clear() val metricConfig = loadConfigOrThrow[MetricConfig](system.settings.config, "user-events") val metricRecorder = PrometheusRecorder(new PrometheusReporter, metricConfig) - val consumer = createConsumer(kafkaPort, system.settings.config, metricRecorder) + val consumer = createConsumer(embeddedKafkaConfig.kafkaPort, system.settings.config, metricRecorder) publishStringMessageToKafka( EventConsumer.userEventTopic, newActivationEvent(s"$namespaceDemo/$actionWithCustomPackage", kind, memory).serialize) @@ -107,7 +107,7 @@ class PrometheusRecorderTests extends KafkaSpecBase with BeforeAndAfterEach with CollectorRegistry.defaultRegistry.clear() val metricConfig = loadConfigOrThrow[MetricConfig](config, "whisk.user-events") val metricRecorder = PrometheusRecorder(new PrometheusReporter, metricConfig) - val consumer = createConsumer(kafkaPort, system.settings.config, metricRecorder) + val consumer = createConsumer(embeddedKafkaConfig.kafkaPort, system.settings.config, metricRecorder) publishStringMessageToKafka( EventConsumer.userEventTopic, diff --git a/core/scheduler/build.gradle b/core/scheduler/build.gradle index b18dba9739c..465cf7041ee 100644 --- a/core/scheduler/build.gradle +++ b/core/scheduler/build.gradle @@ -20,7 +20,7 @@ apply plugin: 'application' apply plugin: 'eclipse' apply plugin: 'maven-publish' apply plugin: 'org.scoverage' -apply plugin: 'com.lightbend.akka.grpc.gradle' +apply plugin: 'org.apache.pekko.grpc.gradle' ext.dockerImageName = 'scheduler' apply from: '../../gradle/docker.gradle' @@ -41,14 +41,15 @@ ext.coverageDirs = [ buildscript { repositories { mavenLocal() + mavenCentral() maven { url "https://plugins.gradle.org/m2/" } } dependencies { - // see https://plugins.gradle.org/plugin/com.lightbend.akka.grpc.gradle - // for the currently latest version. - classpath 'com.lightbend.akka.grpc:akka-grpc-gradle-plugin:1.0.2' + // Pekko gRPC plugin is deployed in Maven Central + // See: https://pekko.apache.org/docs/pekko-grpc/current/release-notes/ + classpath "org.apache.pekko:pekko-grpc-gradle-plugin:${gradle.pekko_grpc.version}" } } @@ -70,33 +71,31 @@ configurations { dependencies { configurations.all { resolutionStrategy.force "com.lihaoyi:fastparse_${gradle.scala.depVersion}:2.3.0" - resolutionStrategy.force "com.typesafe.akka:akka-http-core_${gradle.scala.depVersion}:${gradle.akka_http.version}" - resolutionStrategy.force "com.typesafe.akka:akka-http_${gradle.scala.depVersion}:${gradle.akka_http.version}" - resolutionStrategy.force "com.typesafe.akka:akka-http2-support_${gradle.scala.depVersion}:${gradle.akka_http.version}" - resolutionStrategy.force "com.typesafe.akka:akka-http-spray-json_${gradle.scala.depVersion}:${gradle.akka_http.version}" - resolutionStrategy.force "com.typesafe.akka:akka-parsing_${gradle.scala.depVersion}:${gradle.akka_http.version}" - resolutionStrategy.force "com.typesafe.akka:akka-http_${gradle.scala.depVersion}:${gradle.akka_http.version}" + resolutionStrategy.force "org.apache.pekko:pekko-http-core_${gradle.scala.depVersion}:${gradle.pekko_http.version}" + resolutionStrategy.force "org.apache.pekko:pekko-http_${gradle.scala.depVersion}:${gradle.pekko_http.version}" + resolutionStrategy.force "org.apache.pekko:pekko-http2-support_${gradle.scala.depVersion}:${gradle.pekko_http.version}" + resolutionStrategy.force "org.apache.pekko:pekko-http-spray-json_${gradle.scala.depVersion}:${gradle.pekko_http.version}" + resolutionStrategy.force "org.apache.pekko:pekko-parsing_${gradle.scala.depVersion}:${gradle.pekko_http.version}" + resolutionStrategy.force "org.apache.pekko:pekko-http_${gradle.scala.depVersion}:${gradle.pekko_http.version}" } implementation "org.scala-lang:scala-library:${gradle.scala.version}" implementation project(':common:scala') - implementation "io.altoo:akka-kryo-serialization_${gradle.scala.depVersion}:1.0.0" - implementation "com.lightbend.akka.management:akka-management-cluster-bootstrap_${gradle.scala.depVersion}:${gradle.akka_management.version}" - implementation "com.lightbend.akka.discovery:akka-discovery-kubernetes-api_${gradle.scala.depVersion}:${gradle.akka_management.version}" + implementation "io.altoo:pekko-kryo-serialization_${gradle.scala.depVersion}:1.3.0" + implementation "org.apache.pekko:pekko-management-cluster-bootstrap_${gradle.scala.depVersion}:${gradle.pekko_management.version}" + implementation "org.apache.pekko:pekko-discovery-kubernetes-api_${gradle.scala.depVersion}:${gradle.pekko_management.version}" } -// workaround for akka-grpc -// https://github.com/akka/akka-grpc/issues/786 printProtocLogs.doFirst { mkdir "$buildDir" - file("$buildDir/akka-grpc-gradle-plugin.log").text = "x" + file("$buildDir/pekko-grpc-gradle-plugin.log").text = "x" mkdir "$project.rootDir/build" - file("$project.rootDir/build/akka-grpc-gradle-plugin.log").text = "x" + file("$project.rootDir/build/pekko-grpc-gradle-plugin.log").text = "x" } printProtocLogs.configure { mkdir "$buildDir" - file("$buildDir/akka-grpc-gradle-plugin.log").text = "x" + file("$buildDir/pekko-grpc-gradle-plugin.log").text = "x" mkdir "$project.rootDir/build" - file("$project.rootDir/build/akka-grpc-gradle-plugin.log").text = "x" + file("$project.rootDir/build/pekko-grpc-gradle-plugin.log").text = "x" } mainClassName = "org.apache.openwhisk.core.scheduler.Scheduler" diff --git a/core/scheduler/init.sh b/core/scheduler/init.sh index 6801156301c..40ba1d44c4b 100644 --- a/core/scheduler/init.sh +++ b/core/scheduler/init.sh @@ -19,6 +19,6 @@ ./copyJMXFiles.sh export SCHEDULER_OPTS -SCHEDULER_OPTS="$SCHEDULER_OPTS -Dakka.remote.artery.bind.hostname=$(hostname -i) $(./transformEnvironment.sh)" +SCHEDULER_OPTS="$SCHEDULER_OPTS -Dpekko.remote.artery.bind.hostname=$(hostname -i) $(./transformEnvironment.sh)" exec scheduler/bin/scheduler "$@" diff --git a/core/scheduler/src/main/java/Empty.java b/core/scheduler/src/main/java/Empty.java deleted file mode 100644 index b982d8f506a..00000000000 --- a/core/scheduler/src/main/java/Empty.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -public class Empty { - // Workaround for this issue https://github.com/akka/akka-grpc/issues/289 - // Gradle complains about no java sources. - // Note. Openwhisk is using a lower gradle version, so the latest akka-grpc version cannot be used. -} diff --git a/core/scheduler/src/main/resources/application.conf b/core/scheduler/src/main/resources/application.conf index 2856c84e32c..59236273d08 100644 --- a/core/scheduler/src/main/resources/application.conf +++ b/core/scheduler/src/main/resources/application.conf @@ -16,12 +16,12 @@ # -akka { +pekko { actor { provider = cluster allow-java-serialization = off serializers { - kryo = "io.altoo.akka.serialization.kryo.KryoSerializer" + kryo = "io.altoo.serialization.kryo.pekko.PekkoKryoSerializer" } serialization-bindings { "org.apache.openwhisk.core.scheduler.queue.CreateQueue" = kryo @@ -48,12 +48,12 @@ akka { cluster { shutdown-after-unsuccessful-join-seed-nodes = 60s - # Disable legacy metrics in akka-cluster. + # Disable legacy metrics in pekko-cluster. metrics.enabled = off } } -akka-kryo-serialization.kryo-initializer = "org.apache.openwhisk.core.scheduler.CompatibleKryoInitializer" +pekko-kryo-serialization.kryo-initializer = "org.apache.openwhisk.core.scheduler.CompatibleKryoInitializer" whisk { cluster { diff --git a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/FPCSchedulerServer.scala b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/FPCSchedulerServer.scala index 7a8152ae959..9e761c4e3c0 100644 --- a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/FPCSchedulerServer.scala +++ b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/FPCSchedulerServer.scala @@ -17,12 +17,12 @@ package org.apache.openwhisk.core.scheduler -import akka.actor.ActorSystem -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.model.StatusCodes.OK -import akka.http.scaladsl.model.headers.BasicHttpCredentials -import akka.http.scaladsl.server.Route +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.StatusCodes.OK +import org.apache.pekko.http.scaladsl.model.headers.BasicHttpCredentials +import org.apache.pekko.http.scaladsl.server.Route import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.core.ConfigKeys import org.apache.openwhisk.http.BasicRasService diff --git a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/Scheduler.scala b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/Scheduler.scala index 701b392b286..88b70efaa18 100644 --- a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/Scheduler.scala +++ b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/Scheduler.scala @@ -17,17 +17,17 @@ package org.apache.openwhisk.core.scheduler -import akka.Done -import akka.actor.{ActorRef, ActorRefFactory, ActorSelection, ActorSystem, CoordinatedShutdown, Props} -import akka.http.scaladsl.Http -import akka.http.scaladsl.model.{HttpRequest, HttpResponse} -import akka.management.scaladsl.AkkaManagement -import akka.management.cluster.bootstrap.ClusterBootstrap -import akka.pattern.ask -import akka.util.Timeout +import org.apache.pekko.Done +import org.apache.pekko.actor.{ActorRef, ActorRefFactory, ActorSelection, ActorSystem, CoordinatedShutdown, Props} +import org.apache.pekko.http.scaladsl.Http +import org.apache.pekko.http.scaladsl.model.{HttpRequest, HttpResponse} +import org.apache.pekko.management.scaladsl.PekkoManagement +import org.apache.pekko.management.cluster.bootstrap.ClusterBootstrap +import org.apache.pekko.pattern.ask +import org.apache.pekko.util.Timeout import com.typesafe.config.ConfigValueFactory -import io.altoo.akka.serialization.kryo.DefaultKryoInitializer -import io.altoo.akka.serialization.kryo.serializer.scala.ScalaKryo +import io.altoo.serialization.kryo.pekko.DefaultKryoInitializer +import io.altoo.serialization.kryo.scala.serializer.ScalaKryo import kamon.Kamon import org.apache.openwhisk.common.Https.HttpsConfig import org.apache.openwhisk.common._ @@ -267,13 +267,13 @@ object Scheduler { val topicPrefix = loadConfigOrThrow[String](ConfigKeys.kafkaTopicsPrefix) /** - * The scheduler has two ports, one for akka-remote and the other for akka-grpc. + * The scheduler has two ports, one for pekko-remote and the other for pekko-grpc. */ def requiredProperties = Map( servicePort -> 8080.toString, schedulerHost -> null, - schedulerAkkaPort -> null, + schedulerPekkoPort -> null, schedulerRpcPort -> null, WhiskConfig.actionInvokeConcurrentLimit -> null) ++ kafkaHosts ++ @@ -291,10 +291,10 @@ object Scheduler { implicit val actorSystem: ActorSystem = ActorSystem(name = "scheduler-actor-system", defaultExecutionContext = Some(ec)) - implicit val logger = new AkkaLogging(akka.event.Logging.getLogger(actorSystem, this)) + implicit val logger = new PekkoLogging(org.apache.pekko.event.Logging.getLogger(actorSystem, this)) if (useClusterBootstrap) { - AkkaManagement(actorSystem).start() + PekkoManagement(actorSystem).start() ClusterBootstrap(actorSystem).start() } @@ -320,7 +320,7 @@ object Scheduler { val port = config.servicePort.toInt val host = config.schedulerHost val rpcPort = config.schedulerRpcPort.toInt - val akkaPort = config.schedulerAkkaPort.toInt + val pekkoPort = config.schedulerPekkoPort.toInt // if deploying multiple instances (scale out), must pass the instance number as they need to be uniquely identified. require(args.length >= 1, "scheduler instance required") @@ -345,7 +345,7 @@ object Scheduler { ExecManifest.initialize(config) match { case Success(_) => - val schedulerEndpoints = SchedulerEndpoints(host, rpcPort, akkaPort) + val schedulerEndpoints = SchedulerEndpoints(host, rpcPort, pekkoPort) // Create scheduler val scheduler = new Scheduler(instanceId, schedulerEndpoints) @@ -365,15 +365,15 @@ object Scheduler { } } } -case class SchedulerEndpoints(host: String, rpcPort: Int, akkaPort: Int) { - require(rpcPort != 0 || akkaPort != 0) +case class SchedulerEndpoints(host: String, rpcPort: Int, pekkoPort: Int) { + require(rpcPort != 0 || pekkoPort != 0) def asRpcEndpoint: String = s"$host:$rpcPort" - def asAkkaEndpoint: String = s"$host:$akkaPort" + def asPekkoEndpoint: String = s"$host:$pekkoPort" def getRemoteRef(name: String)(implicit context: ActorRefFactory): ActorSelection = { implicit val ec = context.dispatcher - val path = s"akka://scheduler-actor-system@${asAkkaEndpoint}/user/${name}" + val path = s"pekko://scheduler-actor-system@${asPekkoEndpoint}/user/${name}" context.actorSelection(path) } @@ -381,7 +381,7 @@ case class SchedulerEndpoints(host: String, rpcPort: Int, akkaPort: Int) { } object SchedulerEndpoints extends DefaultJsonProtocol { - implicit val serdes = jsonFormat(SchedulerEndpoints.apply, "host", "rpcPort", "akkaPort") + implicit val serdes = jsonFormat(SchedulerEndpoints.apply, "host", "rpcPort", "pekkoPort") def parse(endpoints: String) = Try(serdes.read(endpoints.parseJson)) } @@ -391,7 +391,7 @@ case class SchedulerStates(sid: SchedulerInstanceId, queueSize: Int, endpoints: def getRemoteRef(name: String)(implicit context: ActorRefFactory): ActorSelection = { implicit val ec = context.dispatcher - val path = s"akka://scheduler-actor-system@${endpoints.asAkkaEndpoint}/user/${name}" + val path = s"pekko://scheduler-actor-system@${endpoints.asPekkoEndpoint}/user/${name}" context.actorSelection(path) } @@ -430,6 +430,8 @@ case class SchedulingConfig(staleThreshold: FiniteDuration, class CompatibleKryoInitializer extends DefaultKryoInitializer { override def preInit(kryo: ScalaKryo): Unit = { - kryo.setDefaultSerializer(classOf[com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer[_]]) + super.preInit(kryo) + // Use CompatibleFieldSerializer for schema evolution support + kryo.setDefaultSerializer(classOf[com.esotericsoftware.kryo.kryo5.serializers.CompatibleFieldSerializer[_]]) } } diff --git a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/container/ContainerManager.scala b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/container/ContainerManager.scala index 8d684b2d33f..77498249935 100644 --- a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/container/ContainerManager.scala +++ b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/container/ContainerManager.scala @@ -16,8 +16,8 @@ */ package org.apache.openwhisk.core.scheduler.container -import akka.actor.{Actor, ActorRef, ActorRefFactory, ActorSystem, Props} -import akka.event.Logging.InfoLevel +import org.apache.pekko.actor.{Actor, ActorRef, ActorRefFactory, ActorSystem, Props} +import org.apache.pekko.event.Logging.InfoLevel import org.apache.openwhisk.common.InvokerState.{Healthy, Offline, Unhealthy} import org.apache.openwhisk.common._ import org.apache.openwhisk.core.connector.ContainerCreationError.{ diff --git a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/container/CreationJobManager.scala b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/container/CreationJobManager.scala index c9579ffa1d3..144e2b0e87e 100644 --- a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/container/CreationJobManager.scala +++ b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/container/CreationJobManager.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.core.scheduler.container import java.nio.charset.StandardCharsets import java.util.concurrent.TimeUnit -import akka.actor.{Actor, ActorRef, ActorRefFactory, ActorSystem, Cancellable, Props} +import org.apache.pekko.actor.{Actor, ActorRef, ActorRefFactory, ActorSystem, Cancellable, Props} import org.apache.openwhisk.common.{GracefulShutdown, Logging} import org.apache.openwhisk.core.connector._ import org.apache.openwhisk.core.entity._ diff --git a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/grpc/ActivationServiceImpl.scala b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/grpc/ActivationServiceImpl.scala index 8a3db898a5b..81c45ec75c9 100644 --- a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/grpc/ActivationServiceImpl.scala +++ b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/grpc/ActivationServiceImpl.scala @@ -17,9 +17,9 @@ package org.apache.openwhisk.core.scheduler.grpc -import akka.actor.ActorSystem -import akka.pattern.ask -import akka.util.Timeout +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.pattern.ask +import org.apache.pekko.util.Timeout import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.core.WarmUp import org.apache.openwhisk.core.connector.{ActivationMessage, Message} diff --git a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/ContainerCounter.scala b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/ContainerCounter.scala index 7859a190d7e..54c5f54f7a1 100644 --- a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/ContainerCounter.scala +++ b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/ContainerCounter.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.core.scheduler.queue import java.util.concurrent.atomic.AtomicInteger -import akka.actor.{Actor, ActorRef, ActorSystem, Props} +import org.apache.pekko.actor.{Actor, ActorRef, ActorSystem, Props} import org.apache.openwhisk.common.Logging import org.apache.openwhisk.core.etcd.EtcdClient import org.apache.openwhisk.core.etcd.EtcdKV.ContainerKeys diff --git a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/ElasticSearchDurationChecker.scala b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/ElasticSearchDurationChecker.scala index 88e1f2ff177..cdab48f89dd 100644 --- a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/ElasticSearchDurationChecker.scala +++ b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/ElasticSearchDurationChecker.scala @@ -16,7 +16,7 @@ */ package org.apache.openwhisk.core.scheduler.queue -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import com.sksamuel.elastic4s.http.ElasticDsl._ import com.sksamuel.elastic4s.http.{ElasticClient, ElasticProperties, NoOpRequestConfigCallback} import com.sksamuel.elastic4s.searches.queries.Query diff --git a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/MemoryQueue.scala b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/MemoryQueue.scala index 21c77719488..90778fb26e4 100644 --- a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/MemoryQueue.scala +++ b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/MemoryQueue.scala @@ -17,9 +17,9 @@ package org.apache.openwhisk.core.scheduler.queue -import akka.actor.Status.{Failure => FailureMessage} -import akka.actor.{ActorRef, ActorSystem, Cancellable, FSM, Props, Stash} -import akka.util.Timeout +import org.apache.pekko.actor.Status.{Failure => FailureMessage} +import org.apache.pekko.actor.{ActorRef, ActorSystem, Cancellable, FSM, Props, Stash} +import org.apache.pekko.util.Timeout import org.apache.openwhisk.common._ import org.apache.openwhisk.common.time.{Clock, SystemClock} import org.apache.openwhisk.core.ConfigKeys diff --git a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/NoopDurationChecker.scala b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/NoopDurationChecker.scala index 441bfed53c4..b98f52848c3 100644 --- a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/NoopDurationChecker.scala +++ b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/NoopDurationChecker.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.scheduler.queue -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import org.apache.openwhisk.common.Logging import org.apache.openwhisk.core.entity.WhiskActionMetaData diff --git a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/QueueManager.scala b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/QueueManager.scala index 6d0eed87566..d7d9ce4a05f 100644 --- a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/QueueManager.scala +++ b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/QueueManager.scala @@ -20,9 +20,9 @@ package org.apache.openwhisk.core.scheduler.queue import java.nio.charset.StandardCharsets import java.time.Instant -import akka.actor.{Actor, ActorRef, ActorRefFactory, ActorSelection, PoisonPill, Props} -import akka.pattern.ask -import akka.util.Timeout +import org.apache.pekko.actor.{Actor, ActorRef, ActorRefFactory, ActorSelection, PoisonPill, Props} +import org.apache.pekko.pattern.ask +import org.apache.pekko.util.Timeout import org.apache.openwhisk.common._ import org.apache.openwhisk.core.ConfigKeys import org.apache.openwhisk.core.WarmUp.isWarmUpAction @@ -258,7 +258,7 @@ class QueueManager( // this is for graceful shutdown of the feed as well. // When the scheduler endpoint is removed, there can be some unprocessed data in Kafka // So we would wait for some time to consume all messages in Kafka - akka.pattern.after(5.seconds, system.scheduler) { + org.apache.pekko.pattern.after(5.seconds, system.scheduler) { feed ! GracefulShutdown Future.successful({}) } @@ -522,7 +522,7 @@ class QueueManager( val wait = if (curWait == 0) initWait else Math.ceil(curWait * factor).toInt - akka.pattern.after(wait.milliseconds, system.scheduler) { + org.apache.pekko.pattern.after(wait.milliseconds, system.scheduler) { val message = s"${e.getMessage} retrying after ${wait}ms ($retries/$maxRetries)" if (retries == maxRetries) { // if number of retries reaches maxRetries, print warning level log diff --git a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/SchedulingDecisionMaker.scala b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/SchedulingDecisionMaker.scala index 473896aca6d..a8cdf44bebe 100644 --- a/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/SchedulingDecisionMaker.scala +++ b/core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/SchedulingDecisionMaker.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.scheduler.queue -import akka.actor.{Actor, ActorSystem, Props} +import org.apache.pekko.actor.{Actor, ActorSystem, Props} import org.apache.openwhisk.common.Logging import org.apache.openwhisk.core.entity.FullyQualifiedEntityName import org.apache.openwhisk.core.scheduler.SchedulingConfig diff --git a/core/standalone/build.gradle b/core/standalone/build.gradle index 07186479517..5b04083611f 100644 --- a/core/standalone/build.gradle +++ b/core/standalone/build.gradle @@ -169,18 +169,22 @@ dependencies { implementation project(':tools:admin') implementation "org.rogach:scallop_${gradle.scala.depVersion}:3.3.2" - implementation "io.github.embeddedkafka:embedded-kafka_${gradle.scala.depVersion}:2.8.1" + implementation "io.github.embeddedkafka:embedded-kafka_${gradle.scala.depVersion}:3.9.1" constraints { - implementation("io.github.embeddedkafka:embedded-kafka_${gradle.scala.depVersion}:2.8.1") - implementation('org.apache.avro:avro:1.11.1') { - because 'embeddedkafka dependency cannot be upgraded currently and avro in embedded kafka 2.4.0 has vulns' - } + implementation("io.github.embeddedkafka:embedded-kafka_${gradle.scala.depVersion}:3.9.1") + implementation("org.apache.kafka:kafka-clients:3.9.1") + } + implementation ("org.apache.zookeeper:zookeeper:3.9.3") { + exclude group: 'org.slf4j' + exclude group: 'log4j' + exclude group: 'jline' } implementation "org.scala-lang:scala-reflect:${gradle.scala.version}" - implementation "ch.megard:akka-http-cors_${gradle.scala.depVersion}:0.4.2" + implementation "org.apache.pekko:pekko-http-cors_${gradle.scala.depVersion}:${gradle.pekko_http.version}" testImplementation "junit:junit:4.11" - testImplementation "org.scalatest:scalatest_${gradle.scala.depVersion}:3.0.8" + testImplementation "org.scalatest:scalatest_${gradle.scala.depVersion}:3.2.14" + testImplementation "org.scalatestplus:junit-4-13_${gradle.scala.depVersion}:3.2.14.0" } gradle.projectsEvaluated { diff --git a/core/standalone/src/main/resources/standalone.conf b/core/standalone/src/main/resources/standalone.conf index b6acaac8e50..d58491691c3 100644 --- a/core/standalone/src/main/resources/standalone.conf +++ b/core/standalone/src/main/resources/standalone.conf @@ -142,7 +142,7 @@ whisk { } } -akka-http-cors { +pekko-http-cors { allow-generic-http-requests = yes allow-credentials = yes allowed-origins = "*" diff --git a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/ApiGwLauncher.scala b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/ApiGwLauncher.scala index 2080c8ab9eb..ed6b0f381bd 100644 --- a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/ApiGwLauncher.scala +++ b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/ApiGwLauncher.scala @@ -17,9 +17,9 @@ package org.apache.openwhisk.standalone -import akka.actor.{ActorSystem, Scheduler} -import akka.http.scaladsl.model.Uri -import akka.pattern.RetrySupport +import org.apache.pekko.actor.{ActorSystem, Scheduler} +import org.apache.pekko.http.scaladsl.model.Uri +import org.apache.pekko.pattern.RetrySupport import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.standalone.StandaloneDockerSupport.{containerName, createRunCmd} import pureconfig._ diff --git a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/CouchDBLauncher.scala b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/CouchDBLauncher.scala index 5a54f95a6c9..25220cb7fab 100644 --- a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/CouchDBLauncher.scala +++ b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/CouchDBLauncher.scala @@ -21,11 +21,19 @@ import java.io.File import java.net.URLEncoder import java.nio.charset.StandardCharsets.UTF_8 -import akka.Done -import akka.actor.ActorSystem -import akka.http.scaladsl.model.headers.{Accept, Authorization, BasicHttpCredentials} -import akka.http.scaladsl.model.{HttpHeader, HttpMethods, HttpRequest, MediaTypes, StatusCode, StatusCodes, Uri} -import akka.http.scaladsl.unmarshalling.Unmarshal +import org.apache.pekko.Done +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model.headers.{Accept, Authorization, BasicHttpCredentials} +import org.apache.pekko.http.scaladsl.model.{ + HttpHeader, + HttpMethods, + HttpRequest, + MediaTypes, + StatusCode, + StatusCodes, + Uri +} +import org.apache.pekko.http.scaladsl.unmarshalling.Unmarshal import com.typesafe.config.ConfigFactory import org.apache.commons.io.IOUtils import org.apache.openwhisk.common.{Logging, TransactionId} diff --git a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/InstallRouteMgmt.scala b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/InstallRouteMgmt.scala index ad61af24958..e9a9cb62861 100644 --- a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/InstallRouteMgmt.scala +++ b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/InstallRouteMgmt.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.standalone import java.io.File -import akka.http.scaladsl.model.Uri +import org.apache.pekko.http.scaladsl.model.Uri import org.apache.commons.io.{FileUtils, IOUtils} import org.apache.openwhisk.common.TransactionId.systemPrefix import org.apache.openwhisk.common.{Logging, TransactionId} diff --git a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/KafkaLauncher.scala b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/KafkaLauncher.scala index a7be4abead1..7af1c77c8d7 100644 --- a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/KafkaLauncher.scala +++ b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/KafkaLauncher.scala @@ -18,8 +18,7 @@ package org.apache.openwhisk.standalone import java.io.File -import akka.actor.ActorSystem -import kafka.server.KafkaConfig +import org.apache.pekko.actor.ActorSystem import io.github.embeddedkafka.{EmbeddedKafka, EmbeddedKafkaConfig} import org.apache.commons.io.FileUtils import org.apache.openwhisk.common.{Logging, TransactionId} @@ -57,11 +56,11 @@ class KafkaLauncher( // Here controller / invoker will use LISTENER_LOCAL since they run in the same JVM as the embedded Kafka // and Kafka UI will run in a Docker container and use LISTENER_DOCKER val brokerProps = Map( - KafkaConfig.ListenersProp -> s"LISTENER_LOCAL://localhost:$kafkaPort,LISTENER_DOCKER://localhost:$kafkaDockerPort", - KafkaConfig.AdvertisedListenersProp -> s"LISTENER_LOCAL://localhost:$kafkaPort,LISTENER_DOCKER://${StandaloneDockerSupport + "listeners" -> s"LISTENER_LOCAL://localhost:$kafkaPort,LISTENER_DOCKER://localhost:$kafkaDockerPort", + "advertised.listeners" -> s"LISTENER_LOCAL://localhost:$kafkaPort,LISTENER_DOCKER://${StandaloneDockerSupport .getLocalHostIp()}:$kafkaDockerPort", - KafkaConfig.ListenerSecurityProtocolMapProp -> "LISTENER_LOCAL:PLAINTEXT,LISTENER_DOCKER:PLAINTEXT", - KafkaConfig.InterBrokerListenerNameProp -> "LISTENER_LOCAL") + "listener.security.protocol.map" -> "LISTENER_LOCAL:PLAINTEXT,LISTENER_DOCKER:PLAINTEXT", + "inter.broker.listener.name" -> "LISTENER_LOCAL") implicit val config: EmbeddedKafkaConfig = EmbeddedKafkaConfig(kafkaPort = kafkaPort, zooKeeperPort = zkPort, customBrokerProperties = brokerProps) diff --git a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/LogbackConfigurator.scala b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/LogbackConfigurator.scala index 94e1b6da19f..7ea8186e4cb 100644 --- a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/LogbackConfigurator.scala +++ b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/LogbackConfigurator.scala @@ -20,13 +20,13 @@ package org.apache.openwhisk.standalone import java.io.ByteArrayInputStream import java.nio.charset.StandardCharsets.UTF_8 -import akka.event.LoggingAdapter +import org.apache.pekko.event.LoggingAdapter import ch.qos.logback.classic.joran.JoranConfigurator import ch.qos.logback.classic.{Level, LoggerContext} import ch.qos.logback.core.joran.spi.JoranException import ch.qos.logback.core.util.StatusPrinter import org.apache.commons.io.IOUtils -import org.apache.openwhisk.common.{AkkaLogging, TransactionId} +import org.apache.openwhisk.common.{PekkoLogging, TransactionId} import org.slf4j.LoggerFactory import scala.io.AnsiColor @@ -78,9 +78,9 @@ object LogbackConfigurator { } /** - * Similar to AkkaLogging but with color support + * Similar to PekkoLogging but with color support */ -class ColoredAkkaLogging(loggingAdapter: LoggingAdapter) extends AkkaLogging(loggingAdapter) with AnsiColor { +class ColoredPekkoLogging(loggingAdapter: LoggingAdapter) extends PekkoLogging(loggingAdapter) with AnsiColor { import ColorOutput.clr override protected def format(id: TransactionId, name: String, logmsg: String) = diff --git a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/PlaygroundLauncher.scala b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/PlaygroundLauncher.scala index ff52c40cbb0..db49d1254ac 100644 --- a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/PlaygroundLauncher.scala +++ b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/PlaygroundLauncher.scala @@ -19,12 +19,12 @@ package org.apache.openwhisk.standalone import java.nio.charset.StandardCharsets.UTF_8 -import akka.actor.ActorSystem -import akka.http.scaladsl.model._ -import akka.http.scaladsl.server.Route -import akka.http.scaladsl.server.directives.FileAndResourceDirectives.ResourceFile -import akka.stream.scaladsl.{Sink, Source} -import ch.megard.akka.http.cors.scaladsl.CorsDirectives._ +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model._ +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.server.directives.FileAndResourceDirectives.ResourceFile +import org.apache.pekko.stream.scaladsl.{Sink, Source} +import org.apache.pekko.http.cors.scaladsl.CorsDirectives._ import org.apache.commons.io.IOUtils import org.apache.commons.lang3.SystemUtils import org.apache.openwhisk.common.{Logging, TransactionId} diff --git a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/ServerStartupCheck.scala b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/ServerStartupCheck.scala index 56f6f0d9c5a..fd88fd6ce2d 100644 --- a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/ServerStartupCheck.scala +++ b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/ServerStartupCheck.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.standalone import java.net.{HttpURLConnection, URL} -import akka.http.scaladsl.model.Uri +import org.apache.pekko.http.scaladsl.model.Uri import com.google.common.base.Stopwatch import org.apache.openwhisk.utils.retry diff --git a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/StandaloneDockerSupport.scala b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/StandaloneDockerSupport.scala index 8108834b6a9..68215f02123 100644 --- a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/StandaloneDockerSupport.scala +++ b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/StandaloneDockerSupport.scala @@ -21,8 +21,8 @@ import java.io.FileNotFoundException import java.net.{ServerSocket, Socket} import java.nio.file.{Files, Paths} -import akka.Done -import akka.actor.{ActorSystem, CoordinatedShutdown} +import org.apache.pekko.Done +import org.apache.pekko.actor.{ActorSystem, CoordinatedShutdown} import org.apache.commons.lang3.SystemUtils import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.core.ConfigKeys diff --git a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/StandaloneOpenWhisk.scala b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/StandaloneOpenWhisk.scala index 964df73014b..fbec47797e2 100644 --- a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/StandaloneOpenWhisk.scala +++ b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/StandaloneOpenWhisk.scala @@ -21,12 +21,12 @@ import java.io.{ByteArrayInputStream, File} import java.nio.charset.StandardCharsets.UTF_8 import java.util.Properties -import akka.actor.ActorSystem -import akka.event.slf4j.SLF4JLogging -import akka.http.scaladsl.model.Uri +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.event.slf4j.SLF4JLogging +import org.apache.pekko.http.scaladsl.model.Uri import org.apache.commons.io.{FileUtils, FilenameUtils, IOUtils} import org.apache.openwhisk.common.TransactionId.systemPrefix -import org.apache.openwhisk.common.{AkkaLogging, Config, Logging, TransactionId} +import org.apache.openwhisk.common.{Config, Logging, PekkoLogging, TransactionId} import org.apache.openwhisk.core.cli.WhiskAdmin import org.apache.openwhisk.core.controller.Controller import org.apache.openwhisk.core.{ConfigKeys, WhiskConfig} @@ -400,11 +400,11 @@ object StandaloneOpenWhisk extends SLF4JLogging { } private def createLogging(actorSystem: ActorSystem, conf: Conf): Logging = { - val adapter = akka.event.Logging.getLogger(actorSystem, this) + val adapter = org.apache.pekko.event.Logging.getLogger(actorSystem, this) if (conf.disableColorLogging()) - new AkkaLogging(adapter) + new PekkoLogging(adapter) else - new ColoredAkkaLogging(adapter) + new ColoredPekkoLogging(adapter) } private def prepareDocker(conf: Conf)(implicit logging: Logging, diff --git a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/UserEventLauncher.scala b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/UserEventLauncher.scala index 273ac3fd5c7..ed62bb3ebdd 100644 --- a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/UserEventLauncher.scala +++ b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/UserEventLauncher.scala @@ -20,7 +20,7 @@ package org.apache.openwhisk.standalone import java.io.File import java.nio.charset.StandardCharsets.UTF_8 -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import org.apache.commons.io.{FileUtils, IOUtils} import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.standalone.StandaloneDockerSupport.{checkOrAllocatePort, containerName, createRunCmd} diff --git a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/Wsk.scala b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/Wsk.scala index b663d2981a9..7b478e01a80 100644 --- a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/Wsk.scala +++ b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/Wsk.scala @@ -17,11 +17,11 @@ package org.apache.openwhisk.standalone -import akka.Done -import akka.actor.ActorSystem -import akka.http.scaladsl.model.Uri.Query -import akka.http.scaladsl.model.headers.{Accept, Authorization, BasicHttpCredentials} -import akka.http.scaladsl.model.{HttpHeader, HttpMethods, MediaTypes, Uri} +import org.apache.pekko.Done +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model.Uri.Query +import org.apache.pekko.http.scaladsl.model.headers.{Accept, Authorization, BasicHttpCredentials} +import org.apache.pekko.http.scaladsl.model.{HttpHeader, HttpMethods, MediaTypes, Uri} import org.apache.openwhisk.core.database.PutException import org.apache.openwhisk.http.PoolingRestClient import spray.json._ diff --git a/core/standalone/src/test/scala/org/apache/openwhisk/standalone/DockerVersionTests.scala b/core/standalone/src/test/scala/org/apache/openwhisk/standalone/DockerVersionTests.scala index b42af91c30c..a3683d45194 100644 --- a/core/standalone/src/test/scala/org/apache/openwhisk/standalone/DockerVersionTests.scala +++ b/core/standalone/src/test/scala/org/apache/openwhisk/standalone/DockerVersionTests.scala @@ -18,11 +18,12 @@ package org.apache.openwhisk.standalone import org.junit.runner.RunWith -import org.scalatest.{FlatSpec, Matchers} -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -class DockerVersionTests extends FlatSpec with Matchers { +class DockerVersionTests extends AnyFlatSpec with Matchers { behavior of "DockerVersion" it should "parse docker version" in { diff --git a/docs/about.md b/docs/about.md index 6adace5ac3f..095661f0b69 100644 --- a/docs/about.md +++ b/docs/about.md @@ -77,7 +77,7 @@ The first entry point into the system is through **nginx**, “an HTTP and rever ### Entering the system: Controller -Not having done much to our HTTP request, nginx forwards it to the **Controller**, the next component on our trip through OpenWhisk. It is a Scala-based implementation of the actual REST API (based on **Akka** and **Spray**) and thus serves as the interface for everything a user can do, including [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) requests for your entities in OpenWhisk and invocation of actions (which is what we’re doing right now). +Not having done much to our HTTP request, nginx forwards it to the **Controller**, the next component on our trip through OpenWhisk. It is a Scala-based implementation of the actual REST API (based on **Pekko** and **Spray**) and thus serves as the interface for everything a user can do, including [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) requests for your entities in OpenWhisk and invocation of actions (which is what we’re doing right now). The Controller first disambiguates what the user is trying to do. It does so based on the HTTP method you use in your HTTP request. As per translation above, the user is issuing a POST request to an existing action, which the Controller translates to an **invocation of an action**. diff --git a/docs/deploy.md b/docs/deploy.md index ffbe00bd766..e73b23dd1ec 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -20,27 +20,27 @@ This page documents configuration options that should be considered when deployi # Controller Clustering -The system can be configured to use Akka clustering to manage the distributed state of the Controller's load balancing algorithm. This imposes the following constraints on a deployment +The system can be configured to use Apache Pekko clustering to manage the distributed state of the Controller's load balancing algorithm. This imposes the following constraints on a deployment ## Cluster setup To setup a cluster, the controllers need to be able to discover each other. There are 2 basic ways to achieve this: -1. Provide the so called **seed-nodes** explicitly on deployment. Essentially you have a static list of possible seed nodes which are used to build a cluster. In an Ansible based deployment, they are determined for you from the `hosts` file. On any other deployment model, the `CONFIG_akka_cluster_seedNodes.$i` variables will need to be provided according to the [Akka cluster documentation](https://doc.akka.io/docs/akka/2.5/cluster-usage.html#joining-to-seed-nodes). -2. Discover the nodes from an external service. This is built upon [akka-management](https://developer.lightbend.com/docs/akka-management/current/) and by default [Kubernetes](https://developer.lightbend.com/docs/akka-management/current/discovery.html#discovery-method-kubernetes-api) and [Mesos (Marathon)](https://developer.lightbend.com/docs/akka-management/current/discovery.html#discovery-method-marathon-api) are supported. You can refer to the respective documentation above to configure discovery accordingly. +1. Provide the so called **seed-nodes** explicitly on deployment. Essentially you have a static list of possible seed nodes which are used to build a cluster. In an Ansible based deployment, they are determined for you from the `hosts` file. On any other deployment model, the `CONFIG_pekko_cluster_seedNodes.$i` variables will need to be provided according to the [Pekko cluster documentation](https://pekko.apache.org/docs/pekko/current/typed/cluster.html). +2. Discover the nodes from an external service. This is built upon [pekko-management](https://pekko.apache.org/docs/pekko-management/current/) and by default [Kubernetes](https://pekko.apache.org/docs/pekko-management/current/discovery/kubernetes.html) and [Mesos (Marathon)](https://pekko.apache.org/docs/pekko-management/current/discovery/marathon.html) are supported. You can refer to the respective documentation above to configure discovery accordingly. ## Controller nodes must have static IPs/Port combination. It guarantees that failed nodes are able to join the cluster again. -This limitation refers to the fact that Akka clustering doesn't allow to add new nodes when one of the existing members is unreachable (e.g. JVM failure). If each container receives a its ip and port dynamically upon the restart, in case of controller failure, it could come back online under a new ip/port combination which makes cluster consider it as a new member and it won't be added to the cluster (in certain cases it could join as a weeklyUp member). However, the cluster will still replicate the state across the online nodes, it will have trouble to get back to the previous state with desired number of members until the old member is explicitly "downed". +This limitation refers to the fact that Pekko clustering doesn't allow to add new nodes when one of the existing members is unreachable (e.g. JVM failure). If each container receives a its ip and port dynamically upon the restart, in case of controller failure, it could come back online under a new ip/port combination which makes cluster consider it as a new member and it won't be added to the cluster (in certain cases it could join as a weeklyUp member). However, the cluster will still replicate the state across the online nodes, it will have trouble to get back to the previous state with desired number of members until the old member is explicitly "downed". How to down the members. 1. manually (sending an HTTP or JMX request to the controller). For this case an external supervisor for the cluster is required, which will down the nodes and provide an up-to-date list of seed nodes. 2. automatically by setting the "auto-down-property" in controller that will allow the leader to down the node after a certain timeout. In order to mitigate brain split one could define a list of seed nodes which are reachable under static IPs or have static DNS entries. -Link to Akka clustering documentation: -https://doc.akka.io/docs/akka/2.5.4/scala/cluster-usage.html +Link to Pekko clustering documentation: +https://pekko.apache.org/docs/pekko/current/typed/cluster.html ## Shared state vs. Sharding diff --git a/docs/dev/configuration.md b/docs/dev/configuration.md index f511ccfd175..0b2261f8ef7 100644 --- a/docs/dev/configuration.md +++ b/docs/dev/configuration.md @@ -31,5 +31,5 @@ To solve that mismatch, we use a script to transform environment variables into ### Examples: - `CONFIG_whisk_loadbalancer_invokerBusyThreshold` becomes `-Dwhisk.loadbalancer.invoker-busy-threshold` -- `CONFIG_akka_remote_netty_tcp_bindPort` becomes `-Dakka.remote.netty.tcp.bind-port` +- `CONFIG_pekko_remote_netty_tcp_bindPort` becomes `-Dpekko.remote.netty.tcp.bind-port` - `CONFIG_whisk_spi_LogStoreProvider` becomes `-Dwhisk.spi.LogStoreProvider` diff --git a/docs/intra-concurrency.md b/docs/intra-concurrency.md index 9ee445f68fa..0935683e9ff 100644 --- a/docs/intra-concurrency.md +++ b/docs/intra-concurrency.md @@ -27,8 +27,8 @@ Concurrency within a container instance of an actions can improve container reus Concurrent activation processing within the same action container can be enabled by: -* enable the akka http client at invoker config - * e.g. CONFIG_whisk_containerPool_akkaClient=true +* enable the pekko http client at invoker config + * e.g. CONFIG_whisk_containerPool_pekkoClient=true * use a kind that supports concurrency (**currently only the nodejs family / language**) * enable concurrency at runtime container env (nodejs container only allows concurrency when started with an env var __OW_ALLOW_CONCURRENT=true) * e.g. CONFIG_whisk_containerFactory_containerArgs_extraArgs_env_0="__OW_ALLOW_CONCURRENT=true" diff --git a/docs/logging.md b/docs/logging.md index f358bb639d4..1b8698ed0d1 100644 --- a/docs/logging.md +++ b/docs/logging.md @@ -25,7 +25,7 @@ OpenWhisk uses Logback as default logging provider via slf4j. Logback can be configured in the configuration file [logback.xml](../common/scala/src/main/resources/logback.xml). Besides other things this configuration file defines the default log level for OpenWhisk. -Akka Logging inherits the log level defined here. +Pekko Logging inherits the log level defined here. ## Enable debug-level logging for selected namespaces diff --git a/docs/webactions.md b/docs/webactions.md index 83b297fd54d..b0cc33b6b12 100644 --- a/docs/webactions.md +++ b/docs/webactions.md @@ -345,7 +345,7 @@ $ curl https://${APIHOST}/api/v1/web/guest/demo/hello.json?name=Jane -X POST -H } ``` -OpenWhisk uses the [Akka Http](http://doc.akka.io/docs/akka-http/current/scala/http/) framework to [determine](http://doc.akka.io/api/akka-http/10.0.4/akka/http/scaladsl/model/MediaTypes$.html) which content types are binary and which are plain text. +OpenWhisk uses the [Pekko Http](https://pekko.apache.org/docs/pekko-http/current) framework to [determine](https://pekko.apache.org/api/pekko-http/snapshot/org/apache/pekko/http/scaladsl/model/MediaTypes$.html) which content types are binary and which are plain text. ### Enabling raw HTTP handling diff --git a/proposals/POEM-2-function-pulling-container-scheduler.md b/proposals/POEM-2-function-pulling-container-scheduler.md index d5c77549ba0..28abbfa0fc7 100644 --- a/proposals/POEM-2-function-pulling-container-scheduler.md +++ b/proposals/POEM-2-function-pulling-container-scheduler.md @@ -94,7 +94,7 @@ In an abstract view, schedulers provide queueing, container scheduling, and acti * `QueueManager`: The main entry point for queue creation request. It has references to all queues. * `MemoryQueue`: Dynamically created/deleted for each action. It watches the incoming/outgoing requests and triggers container creation. * `ContainerManager`: Schedule container creation requests to appropriate invokers. -* `ActivationServiceImpl`: Provide API for containers to fetch activations via Akka-grpc. It works in a long-poll way to avoid busy-waiting. +* `ActivationServiceImpl`: Provide API for containers to fetch activations via Pekko-grpc. It works in a long-poll way to avoid busy-waiting. #### Controller components * `FPCPoolBalancer`: Create queues if not exist, and forward messages to them. @@ -104,7 +104,7 @@ In an abstract view, schedulers provide queueing, container scheduling, and acti * `FunctionPullingContainerPool`: A container pool for function pulling container. It handles the container creation requests. * `FunctionPullingContainerProxy`: A proxy for a container. It repeatedly fetches activations and invokes them. -* `ActivationClientProxy`: The Akka-grpc client. It communicates with `ActivationServiceImpl` in schedulers. +* `ActivationClientProxy`: The Pekko-grpc client. It communicates with `ActivationServiceImpl` in schedulers. * `InvokerHealthManager`: Manages the health and resources information of invokers. The data is stored in ETCD. If an invoker becomes unhealthy, it invokes health activations. ## Future work diff --git a/settings.gradle b/settings.gradle index 7c882d1f71d..d3506b36ff1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -78,7 +78,9 @@ if (scalaVersion == '2.12') { depVersion : '2.12', scoverageScalaVersion : '2.12.15', scoverageVersion : '1.4.11', - compileFlags: ['-feature', '-unchecked', '-deprecation', '-Xfatal-warnings', '-Ywarn-unused-import'] + // Temporarily disabled -Xfatal-warnings during Pekko migration to allow deprecated API usage + // BEFORE READY: Fix deprecation warnings and re-enable -Xfatal-warnings + compileFlags: ['-feature', '-unchecked', '-deprecation', '-Ywarn-unused-import'] ] } else { println("Build using Scala 2.13") @@ -98,15 +100,15 @@ gradle.ext.scalafmt = [ config: new File(rootProject.projectDir, '.scalafmt.conf') ] -gradle.ext.akka = [version : '2.6.12'] -gradle.ext.akka_kafka = [version : '2.0.7'] -gradle.ext.akka_http = [version : '10.2.7'] -gradle.ext.akka_management = [version : '1.0.10'] -gradle.ext.akka_gprc = [version : '1.0.2'] +// Pekko versions +gradle.ext.pekko = [version : '1.1.5'] +gradle.ext.pekko_kafka = [version : '1.1.0'] +gradle.ext.pekko_http = [version : '1.1.0'] +gradle.ext.pekko_management = [version : '1.1.1'] +gradle.ext.pekko_grpc = [version : '1.1.1'] +gradle.ext.grpc = [version : '1.75.0'] -gradle.ext.grpc = [version : '1.32.1'] - -gradle.ext.curator = [version : '4.3.0'] +gradle.ext.curator = [version : '5.7.0'] gradle.ext.kube_client = [version: '4.10.3'] -gradle.ext.netty = [version : '4.1.100.Final'] +gradle.ext.netty = [version : '4.1.128.Final'] diff --git a/tests/build.gradle b/tests/build.gradle index 2307da2341c..55a2f0800f4 100644 --- a/tests/build.gradle +++ b/tests/build.gradle @@ -214,16 +214,18 @@ task testUnit(type: Test) { dependencies { implementation "org.scala-lang:scala-library:${gradle.scala.version}" - implementation "org.apache.commons:commons-lang3:3.3.2" + implementation "org.apache.commons:commons-lang3:3.18.0" implementation "org.apache.httpcomponents:httpclient:4.5.14:tests" implementation "org.apache.httpcomponents:httpmime:4.3.6" implementation "junit:junit:4.11" implementation "io.rest-assured:rest-assured:4.5.1" - implementation "org.scalatest:scalatest_${gradle.scala.depVersion}:3.0.8" - implementation "com.typesafe.akka:akka-testkit_${gradle.scala.depVersion}:${gradle.akka.version}" + implementation "org.scalatest:scalatest_${gradle.scala.depVersion}:3.2.14" + implementation "org.scalatestplus:junit-4-13_${gradle.scala.depVersion}:3.2.14.0" + implementation "org.scalatestplus:mockito-4-6_${gradle.scala.depVersion}:3.2.14.0" + implementation "org.apache.pekko:pekko-testkit_${gradle.scala.depVersion}:${gradle.pekko.version}" implementation "com.google.code.gson:gson:2.10.1" implementation "org.scalamock:scalamock_${gradle.scala.depVersion}:4.4.0" - implementation "com.typesafe.akka:akka-http-testkit_${gradle.scala.depVersion}:${gradle.akka_http.version}" + implementation "org.apache.pekko:pekko-http-testkit_${gradle.scala.depVersion}:${gradle.pekko_http.version}" implementation "com.github.java-json-tools:json-schema-validator:2.2.8" implementation "org.mockito:mockito-core:2.27.0" implementation "io.opentracing:opentracing-mock:0.31.0" @@ -237,15 +239,18 @@ dependencies { because 'swagger-request-validator-core cannot be upgraded to 2.x where vuln is remediated' } } - implementation "io.github.embeddedkafka:embedded-kafka_${gradle.scala.depVersion}:2.8.1" + implementation "io.github.embeddedkafka:embedded-kafka_${gradle.scala.depVersion}:3.9.1" constraints { - implementation("io.github.embeddedkafka:embedded-kafka_${gradle.scala.depVersion}:2.8.1") - implementation('org.apache.avro:avro:1.11.1') { - because 'embeddedkafka dependency cannot be upgraded currently and avro in embedded kafka 2.4.0 has vulns' - } + implementation("io.github.embeddedkafka:embedded-kafka_${gradle.scala.depVersion}:3.9.1") + implementation("org.apache.kafka:kafka-clients:3.9.1") + } + implementation ("org.apache.zookeeper:zookeeper:3.9.3") { + exclude group: 'org.slf4j' + exclude group: 'log4j' + exclude group: 'jline' } - implementation "com.typesafe.akka:akka-stream-kafka-testkit_${gradle.scala.depVersion}:${gradle.akka_kafka.version}" - implementation "com.typesafe.akka:akka-stream-testkit_${gradle.scala.depVersion}:${gradle.akka.version}" + implementation "org.apache.pekko:pekko-connectors-kafka-testkit_${gradle.scala.depVersion}:${gradle.pekko_kafka.version}" + implementation "org.apache.pekko:pekko-stream-testkit_${gradle.scala.depVersion}:${gradle.pekko.version}" implementation "io.fabric8:kubernetes-server-mock:${gradle.kube_client.version}" implementation "org.rogach:scallop_${gradle.scala.depVersion}:3.3.2" diff --git a/tests/src/test/resources/application.conf.j2 b/tests/src/test/resources/application.conf.j2 index 5e074584b22..9f291be46be 100644 --- a/tests/src/test/resources/application.conf.j2 +++ b/tests/src/test/resources/application.conf.j2 @@ -8,15 +8,15 @@ whisk.spi { } # Blocking requests fall back to non-blocking after ~60s -akka.http.client.idle-timeout = 90 s -akka.http.host-connection-pool.idle-timeout = 90 s -akka.http.host-connection-pool.client.idle-timeout = 90 s +pekko.http.client.idle-timeout = 90 s +pekko.http.host-connection-pool.idle-timeout = 90 s +pekko.http.host-connection-pool.client.idle-timeout = 90 s # Avoid system exit for test runs -akka.jvm-exit-on-fatal-error = off +pekko.jvm-exit-on-fatal-error = off # Each ActorSystem binds to a free port -akka.remote.artery.canonical.port=0 +pekko.remote.artery.canonical.port=0 whisk { feature-flags { diff --git a/tests/src/test/resources/logback-test.xml b/tests/src/test/resources/logback-test.xml index 08f24c41dec..cda6134dfe1 100644 --- a/tests/src/test/resources/logback-test.xml +++ b/tests/src/test/resources/logback-test.xml @@ -18,7 +18,7 @@ - + diff --git a/tests/src/test/scala/actionContainers/ActionContainer.scala b/tests/src/test/scala/actionContainers/ActionContainer.scala index 4e7b4e7faae..57745502143 100644 --- a/tests/src/test/scala/actionContainers/ActionContainer.scala +++ b/tests/src/test/scala/actionContainers/ActionContainer.scala @@ -33,8 +33,9 @@ import scala.sys.process.stringToProcess import scala.util.Random import scala.util.{Failure, Success} import org.apache.commons.lang3.StringUtils -import org.scalatest.{FlatSpec, Matchers} -import akka.actor.ActorSystem +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.apache.pekko.actor.ActorSystem import scala.concurrent.ExecutionContext import spray.json._ @@ -56,7 +57,7 @@ trait ActionContainer { def runMultiple(values: Seq[JsValue])(implicit ec: ExecutionContext): Seq[(Int, Option[JsObject])] } -trait ActionProxyContainerTestUtils extends FlatSpec with Matchers with StreamLogging { +trait ActionProxyContainerTestUtils extends AnyFlatSpec with Matchers with StreamLogging { import ActionContainer.{filterSentinel, sentinel} def initPayload(code: String, main: String = "main", env: Option[Map[String, JsString]] = None): JsObject = @@ -252,7 +253,7 @@ object ActionContainer { implicit val transid = TransactionId.testing - org.apache.openwhisk.core.containerpool.AkkaContainerClient.post(host, port, endPoint, content, 30.seconds) + org.apache.openwhisk.core.containerpool.PekkoContainerClient.post(host, port, endPoint, content, 30.seconds) } private def syncPostForJsArray(host: String, port: Int, endPoint: String, content: JsValue)( @@ -261,7 +262,7 @@ object ActionContainer { implicit val transid = TransactionId.testing - org.apache.openwhisk.core.containerpool.AkkaContainerClient + org.apache.openwhisk.core.containerpool.PekkoContainerClient .postForJsArray(host, port, endPoint, content, 30.seconds) } @@ -271,7 +272,7 @@ object ActionContainer { implicit val transid = TransactionId.testing - org.apache.openwhisk.core.containerpool.AkkaContainerClient + org.apache.openwhisk.core.containerpool.PekkoContainerClient .concurrentPost(host, port, endPoint, contents, 30.seconds) } diff --git a/tests/src/test/scala/actionContainers/BasicActionRunnerTests.scala b/tests/src/test/scala/actionContainers/BasicActionRunnerTests.scala index 6202039d7f4..4634f2e6baa 100644 --- a/tests/src/test/scala/actionContainers/BasicActionRunnerTests.scala +++ b/tests/src/test/scala/actionContainers/BasicActionRunnerTests.scala @@ -19,7 +19,7 @@ package actionContainers import org.junit.runner.RunWith import org.scalatest.exceptions.TestPendingException -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import spray.json.DefaultJsonProtocol._ import spray.json._ diff --git a/tests/src/test/scala/apigw/healthtests/ApiGwEndToEndTests.scala b/tests/src/test/scala/apigw/healthtests/ApiGwEndToEndTests.scala index 7f7c23eb236..835407d327d 100644 --- a/tests/src/test/scala/apigw/healthtests/ApiGwEndToEndTests.scala +++ b/tests/src/test/scala/apigw/healthtests/ApiGwEndToEndTests.scala @@ -24,9 +24,9 @@ import java.io.FileWriter import scala.concurrent.duration.DurationInt import org.junit.runner.RunWith import org.scalatest.BeforeAndAfterAll -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import common.TestHelpers import common.TestUtils import common.TestUtils._ @@ -43,7 +43,7 @@ import system.rest.RestUtil */ @RunWith(classOf[JUnitRunner]) abstract class ApiGwEndToEndTests - extends FlatSpec + extends AnyFlatSpec with Matchers with RestUtil with TestHelpers diff --git a/tests/src/test/scala/apigw/healthtests/ApiGwRestEndToEndTests.scala b/tests/src/test/scala/apigw/healthtests/ApiGwRestEndToEndTests.scala index 577a566ab7e..b70dae3ca77 100644 --- a/tests/src/test/scala/apigw/healthtests/ApiGwRestEndToEndTests.scala +++ b/tests/src/test/scala/apigw/healthtests/ApiGwRestEndToEndTests.scala @@ -21,10 +21,10 @@ import java.io.BufferedWriter import java.io.File import java.io.FileWriter -import akka.http.scaladsl.model.StatusCodes.OK +import org.apache.pekko.http.scaladsl.model.StatusCodes.OK import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common.TestUtils._ import common.rest.WskRestOperations diff --git a/tests/src/test/scala/common/RunCliCmd.scala b/tests/src/test/scala/common/RunCliCmd.scala index 9a31e376515..3c135836f6f 100644 --- a/tests/src/test/scala/common/RunCliCmd.scala +++ b/tests/src/test/scala/common/RunCliCmd.scala @@ -21,7 +21,7 @@ import java.io.File import scala.collection.JavaConverters._ import scala.collection.mutable.Buffer -import org.scalatest.Matchers +import org.scalatest.matchers.should.Matchers import TestUtils._ import scala.concurrent.duration._ import scala.collection.mutable diff --git a/tests/src/test/scala/common/TestHelpers.scala b/tests/src/test/scala/common/TestHelpers.scala index 005468fb959..4b23d2b0d9f 100644 --- a/tests/src/test/scala/common/TestHelpers.scala +++ b/tests/src/test/scala/common/TestHelpers.scala @@ -18,10 +18,10 @@ package common import org.scalatest.BeforeAndAfterEachTestData -import org.scalatest.FlatSpec +import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.TestData -trait TestHelpers extends FlatSpec with BeforeAndAfterEachTestData { +trait TestHelpers extends AnyFlatSpec with BeforeAndAfterEachTestData { override def beforeEach(td: TestData): Unit = { println(s"\nStarting test ${td.name} at ${TestUtils.getDateTime()}") diff --git a/tests/src/test/scala/common/WskActorSystem.scala b/tests/src/test/scala/common/WskActorSystem.scala index 917c4dbd6da..ec103da2aa8 100644 --- a/tests/src/test/scala/common/WskActorSystem.scala +++ b/tests/src/test/scala/common/WskActorSystem.scala @@ -21,8 +21,8 @@ import scala.concurrent.Await import scala.concurrent.ExecutionContext import scala.concurrent.duration.DurationInt -import akka.actor.ActorSystem -import akka.http.scaladsl.Http +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.Http import org.scalatest.BeforeAndAfterAll import org.scalatest.Suite diff --git a/tests/src/test/scala/common/WskTestHelpers.scala b/tests/src/test/scala/common/WskTestHelpers.scala index 69b01c6f468..098947cc9a7 100644 --- a/tests/src/test/scala/common/WskTestHelpers.scala +++ b/tests/src/test/scala/common/WskTestHelpers.scala @@ -19,7 +19,7 @@ package common import java.time.Instant -import org.scalatest.Matchers +import org.scalatest.matchers.should.Matchers import scala.collection.mutable.ListBuffer import scala.util.Failure @@ -33,7 +33,7 @@ import spray.json.DefaultJsonProtocol._ import TestUtils.RunResult import TestUtils.SUCCESS_EXIT import TestUtils.CONFLICT -import akka.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.StatusCodes object FullyQualifiedNames { diff --git a/tests/src/test/scala/common/WskTracingTests.scala b/tests/src/test/scala/common/WskTracingTests.scala index dfb5f0ca484..3a22a6d17b0 100644 --- a/tests/src/test/scala/common/WskTracingTests.scala +++ b/tests/src/test/scala/common/WskTracingTests.scala @@ -21,7 +21,7 @@ import io.opentracing.Span import io.opentracing.mock.{MockSpan, MockTracer} import com.github.benmanes.caffeine.cache.Ticker import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import pureconfig._ import pureconfig.generic.auto._ import org.apache.openwhisk.common.{LoggingMarkers, TransactionId} @@ -29,7 +29,8 @@ import org.apache.openwhisk.common.tracing.{OpenTracer, TracingConfig} import org.apache.openwhisk.core.ConfigKeys import scala.ref.WeakReference -import org.scalatest.{Matchers, TestData} +import org.scalatest.TestData +import org.scalatest.matchers.should.Matchers import scala.collection.JavaConverters._ @RunWith(classOf[JUnitRunner]) diff --git a/tests/src/test/scala/common/rest/SwaggerValidator.scala b/tests/src/test/scala/common/rest/SwaggerValidator.scala index 2e81c9f45e6..cfb7652304c 100644 --- a/tests/src/test/scala/common/rest/SwaggerValidator.scala +++ b/tests/src/test/scala/common/rest/SwaggerValidator.scala @@ -19,9 +19,9 @@ package common.rest import scala.collection.JavaConverters._ -import akka.http.scaladsl.model.HttpEntity -import akka.http.scaladsl.model.HttpRequest -import akka.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.HttpEntity +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.http.scaladsl.model.HttpResponse import com.atlassian.oai.validator.SwaggerRequestResponseValidator import com.atlassian.oai.validator.model.SimpleRequest import com.atlassian.oai.validator.model.SimpleResponse diff --git a/tests/src/test/scala/common/rest/WskRestOperations.scala b/tests/src/test/scala/common/rest/WskRestOperations.scala index 6769ddaafa5..839209d97f2 100644 --- a/tests/src/test/scala/common/rest/WskRestOperations.scala +++ b/tests/src/test/scala/common/rest/WskRestOperations.scala @@ -24,14 +24,14 @@ import java.security.cert.X509Certificate import java.time.Instant import java.util.Base64 -import akka.actor.ActorSystem -import akka.http.scaladsl.{Http, HttpsConnectionContext} -import akka.http.scaladsl.model.HttpMethods.{DELETE, GET, POST, PUT} -import akka.http.scaladsl.model.StatusCodes.{Accepted, NotFound, OK} -import akka.http.scaladsl.model._ -import akka.http.scaladsl.model.Uri.{Path, Query} -import akka.http.scaladsl.model.headers.{Authorization, BasicHttpCredentials, OAuth2BearerToken} -import akka.util.ByteString +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.{Http, HttpsConnectionContext} +import org.apache.pekko.http.scaladsl.model.HttpMethods.{DELETE, GET, POST, PUT} +import org.apache.pekko.http.scaladsl.model.StatusCodes.{Accepted, NotFound, OK} +import org.apache.pekko.http.scaladsl.model._ +import org.apache.pekko.http.scaladsl.model.Uri.{Path, Query} +import org.apache.pekko.http.scaladsl.model.headers.{Authorization, BasicHttpCredentials, OAuth2BearerToken} +import org.apache.pekko.util.ByteString import common.TestUtils.{ANY_ERROR_EXIT, DONTCARE_EXIT, RunResult, SUCCESS_EXIT} import common.rest.SSL.httpsConfig import common.{ @@ -46,10 +46,10 @@ import common.{ import javax.net.ssl._ import org.apache.commons.io.{FileUtils, FilenameUtils} import org.apache.openwhisk.common.Https.HttpsConfig -import org.apache.openwhisk.common.{AkkaLogging, Https, TransactionId} +import org.apache.openwhisk.common.{Https, PekkoLogging, TransactionId} import org.apache.openwhisk.core.entity.ByteSize import org.apache.openwhisk.utils.retry -import org.scalatest.Matchers +import org.scalatest.matchers.should.Matchers import org.scalatest.concurrent.ScalaFutures import org.scalatest.time.Span.convertDurationToSpan import pureconfig._ @@ -1137,7 +1137,7 @@ trait RunRestCmd extends Matchers with ScalaFutures with SwaggerValidator { val maxOpenRequest = 1024 val basePath = Path("/api/v1") val systemNamespace = "whisk.system" - val logger = new AkkaLogging(actorSystem.log) + val logger = new PekkoLogging(actorSystem.log) implicit val config: PatienceConfig = PatienceConfig(100 seconds, 15 milliseconds) implicit val actorSystem: ActorSystem diff --git a/tests/src/test/scala/ha/CacheInvalidationTests.scala b/tests/src/test/scala/ha/CacheInvalidationTests.scala index 33e2d0d896a..d19dee9b50e 100644 --- a/tests/src/test/scala/ha/CacheInvalidationTests.scala +++ b/tests/src/test/scala/ha/CacheInvalidationTests.scala @@ -20,16 +20,16 @@ package ha import scala.concurrent.Await import scala.concurrent.duration.DurationInt import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner -import akka.http.scaladsl.Http -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.marshalling.Marshal -import akka.http.scaladsl.model._ -import akka.http.scaladsl.model.headers.Authorization -import akka.http.scaladsl.model.headers.BasicHttpCredentials -import akka.http.scaladsl.unmarshalling.Unmarshal +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner +import org.apache.pekko.http.scaladsl.Http +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.marshalling.Marshal +import org.apache.pekko.http.scaladsl.model._ +import org.apache.pekko.http.scaladsl.model.headers.Authorization +import org.apache.pekko.http.scaladsl.model.headers.BasicHttpCredentials +import org.apache.pekko.http.scaladsl.unmarshalling.Unmarshal import common.WhiskProperties import common.WskActorSystem import common.WskTestHelpers @@ -39,7 +39,7 @@ import spray.json.DefaultJsonProtocol._ import pureconfig._ @RunWith(classOf[JUnitRunner]) -class CacheInvalidationTests extends FlatSpec with Matchers with WskTestHelpers with WskActorSystem { +class CacheInvalidationTests extends AnyFlatSpec with Matchers with WskTestHelpers with WskActorSystem { val hosts = WhiskProperties.getProperty("controller.hosts").split(",") diff --git a/tests/src/test/scala/ha/ShootComponentsTests.scala b/tests/src/test/scala/ha/ShootComponentsTests.scala index 386b46d1dbc..19781975f56 100644 --- a/tests/src/test/scala/ha/ShootComponentsTests.scala +++ b/tests/src/test/scala/ha/ShootComponentsTests.scala @@ -23,14 +23,14 @@ import scala.concurrent.{Await, Future} import scala.concurrent.duration.DurationInt import scala.util.Try import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import akka.http.scaladsl.Http -import akka.http.scaladsl.model.HttpRequest -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.unmarshalling.Unmarshal +import org.scalatestplus.junit.JUnitRunner +import org.apache.pekko.http.scaladsl.Http +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.unmarshalling.Unmarshal import common._ import common.rest.{HttpConnection, WskRestOperations} import pureconfig._ @@ -45,7 +45,7 @@ import org.apache.openwhisk.utils.retry @RunWith(classOf[JUnitRunner]) class ShootComponentsTests - extends FlatSpec + extends AnyFlatSpec with Matchers with WskTestHelpers with ScalaFutures diff --git a/tests/src/test/scala/invokerShoot/ShootInvokerTests.scala b/tests/src/test/scala/invokerShoot/ShootInvokerTests.scala index 28d7dea47a0..152517051cc 100644 --- a/tests/src/test/scala/invokerShoot/ShootInvokerTests.scala +++ b/tests/src/test/scala/invokerShoot/ShootInvokerTests.scala @@ -21,7 +21,7 @@ import java.io.File import java.nio.charset.StandardCharsets import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common._ import common.rest.WskRestOperations import org.apache.openwhisk.core.entity.{Annotations} diff --git a/tests/src/test/scala/limits/ThrottleTests.scala b/tests/src/test/scala/limits/ThrottleTests.scala index 0d29afe195d..0d33c69e58f 100644 --- a/tests/src/test/scala/limits/ThrottleTests.scala +++ b/tests/src/test/scala/limits/ThrottleTests.scala @@ -19,16 +19,16 @@ package limits import java.time.Instant -import akka.http.scaladsl.model.StatusCodes.TooManyRequests +import org.apache.pekko.http.scaladsl.model.StatusCodes.TooManyRequests import scala.concurrent.{Await, Future, Promise} import scala.concurrent.duration._ import org.junit.runner.RunWith import org.scalatest.BeforeAndAfterAll -import org.scalatest.FlatSpec -import org.scalatest.Matchers +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common._ import common.TestUtils._ import common.rest.WskRestOperations @@ -47,7 +47,7 @@ protected[limits] trait LocalHelper { @RunWith(classOf[JUnitRunner]) class ThrottleTests - extends FlatSpec + extends AnyFlatSpec with TestHelpers with WskTestHelpers with WskActorSystem @@ -233,7 +233,7 @@ class ThrottleTests @RunWith(classOf[JUnitRunner]) class NamespaceSpecificThrottleTests - extends FlatSpec + extends AnyFlatSpec with TestHelpers with WskTestHelpers with WskActorSystem diff --git a/tests/src/test/scala/org/apache/openwhisk/common/ConfigMXBeanTests.scala b/tests/src/test/scala/org/apache/openwhisk/common/ConfigMXBeanTests.scala index c47e5e0a2a6..65405a95796 100644 --- a/tests/src/test/scala/org/apache/openwhisk/common/ConfigMXBeanTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/common/ConfigMXBeanTests.scala @@ -19,11 +19,12 @@ package org.apache.openwhisk.common import java.lang.management.ManagementFactory import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers @RunWith(classOf[JUnitRunner]) -class ConfigMXBeanTests extends FlatSpec with Matchers { +class ConfigMXBeanTests extends AnyFlatSpec with Matchers { behavior of "ConfigMBean" it should "return config at path" in { diff --git a/tests/src/test/scala/org/apache/openwhisk/common/ConfigMapValueTests.scala b/tests/src/test/scala/org/apache/openwhisk/common/ConfigMapValueTests.scala index 3e1727b25aa..5facfb072b0 100644 --- a/tests/src/test/scala/org/apache/openwhisk/common/ConfigMapValueTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/common/ConfigMapValueTests.scala @@ -23,13 +23,14 @@ import java.nio.file.Files import com.typesafe.config.ConfigFactory import org.apache.commons.io.FileUtils import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import pureconfig._ import pureconfig.generic.auto._ @RunWith(classOf[JUnitRunner]) -class ConfigMapValueTests extends FlatSpec with Matchers { +class ConfigMapValueTests extends AnyFlatSpec with Matchers { behavior of "ConfigMapValue" case class ValueTest(template: ConfigMapValue, count: Int) diff --git a/tests/src/test/scala/org/apache/openwhisk/common/ConfigTests.scala b/tests/src/test/scala/org/apache/openwhisk/common/ConfigTests.scala index 6f13575a33e..71df7c07b9c 100644 --- a/tests/src/test/scala/org/apache/openwhisk/common/ConfigTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/common/ConfigTests.scala @@ -18,14 +18,14 @@ package org.apache.openwhisk.common import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import common.StreamLogging @RunWith(classOf[JUnitRunner]) -class ConfigTests extends FlatSpec with Matchers with StreamLogging { +class ConfigTests extends AnyFlatSpec with Matchers with StreamLogging { "Config" should "gets default value" in { val config = new Config(Map("a" -> "A"))(Map.empty) diff --git a/tests/src/test/scala/org/apache/openwhisk/common/ForcibleSemaphoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/common/ForcibleSemaphoreTests.scala index 756521f758a..f55decc6de1 100644 --- a/tests/src/test/scala/org/apache/openwhisk/common/ForcibleSemaphoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/common/ForcibleSemaphoreTests.scala @@ -20,13 +20,14 @@ package org.apache.openwhisk.common import common.ConcurrencyHelpers import org.apache.openwhisk.utils.ExecutionContextFactory import org.junit.runner.RunWith -import org.scalatest.{FlatSpec, Matchers} -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import scala.concurrent.duration.DurationInt @RunWith(classOf[JUnitRunner]) -class ForcibleSemaphoreTests extends FlatSpec with Matchers with ConcurrencyHelpers { +class ForcibleSemaphoreTests extends AnyFlatSpec with Matchers with ConcurrencyHelpers { // use an infinite thread pool to allow for maximum concurrency implicit val executionContext = ExecutionContextFactory.makeCachedThreadPoolExecutionContext() diff --git a/tests/src/test/scala/org/apache/openwhisk/common/NestedSemaphoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/common/NestedSemaphoreTests.scala index b421d03c447..a47e480528d 100644 --- a/tests/src/test/scala/org/apache/openwhisk/common/NestedSemaphoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/common/NestedSemaphoreTests.scala @@ -20,14 +20,14 @@ package org.apache.openwhisk.common import common.ConcurrencyHelpers import org.apache.openwhisk.utils.ExecutionContextFactory import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import scala.concurrent.duration.DurationInt @RunWith(classOf[JUnitRunner]) -class NestedSemaphoreTests extends FlatSpec with Matchers with ConcurrencyHelpers { +class NestedSemaphoreTests extends AnyFlatSpec with Matchers with ConcurrencyHelpers { // use an infinite thread pool to allow for maximum concurrency implicit val executionContext = ExecutionContextFactory.makeCachedThreadPoolExecutionContext() val acquireTimeout = 1.minute diff --git a/tests/src/test/scala/org/apache/openwhisk/common/PrometheusTests.scala b/tests/src/test/scala/org/apache/openwhisk/common/PrometheusTests.scala index f8e456c0df8..1e6f1f60fce 100644 --- a/tests/src/test/scala/org/apache/openwhisk/common/PrometheusTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/common/PrometheusTests.scala @@ -16,24 +16,31 @@ */ package org.apache.openwhisk.common -import akka.http.scaladsl.coding.{Coders} -import akka.http.scaladsl.model.{HttpCharsets, HttpResponse} -import akka.http.scaladsl.model.headers.HttpEncodings.gzip -import akka.http.scaladsl.model.headers.{`Accept-Encoding`, `Content-Encoding`, HttpEncoding, HttpEncodings} -import akka.http.scaladsl.testkit.ScalatestRouteTest -import akka.http.scaladsl.unmarshalling.Unmarshal +import org.apache.pekko.http.scaladsl.coding.{Coders} +import org.apache.pekko.http.scaladsl.model.{HttpCharsets, HttpResponse} +import org.apache.pekko.http.scaladsl.model.headers.HttpEncodings.gzip +import org.apache.pekko.http.scaladsl.model.headers.{`Accept-Encoding`, `Content-Encoding`, HttpEncoding, HttpEncodings} +import org.apache.pekko.http.scaladsl.testkit.ScalatestRouteTest +import org.apache.pekko.http.scaladsl.unmarshalling.Unmarshal import com.typesafe.config.ConfigFactory import kamon.Kamon import org.junit.runner.RunWith import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import org.scalatest.matchers.Matcher -import org.scalatest.{BeforeAndAfterAll, FlatSpec, Matchers} +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import scala.concurrent.duration._ @RunWith(classOf[JUnitRunner]) -class PrometheusTests extends FlatSpec with Matchers with ScalatestRouteTest with BeforeAndAfterAll with ScalaFutures { +class PrometheusTests + extends AnyFlatSpec + with Matchers + with ScalatestRouteTest + with BeforeAndAfterAll + with ScalaFutures { behavior of "Prometheus" override protected def beforeAll(): Unit = { diff --git a/tests/src/test/scala/org/apache/openwhisk/common/ResizableSemaphoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/common/ResizableSemaphoreTests.scala index 4115c0e1b23..b1a19f22330 100644 --- a/tests/src/test/scala/org/apache/openwhisk/common/ResizableSemaphoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/common/ResizableSemaphoreTests.scala @@ -20,14 +20,14 @@ package org.apache.openwhisk.common import common.ConcurrencyHelpers import org.apache.openwhisk.utils.ExecutionContextFactory import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import scala.concurrent.duration.DurationInt @RunWith(classOf[JUnitRunner]) -class ResizableSemaphoreTests extends FlatSpec with Matchers with ConcurrencyHelpers { +class ResizableSemaphoreTests extends AnyFlatSpec with Matchers with ConcurrencyHelpers { // use an infinite thread pool to allow for maximum concurrency implicit val executionContext = ExecutionContextFactory.makeCachedThreadPoolExecutionContext() val acquireTimeout = 1.minute diff --git a/tests/src/test/scala/org/apache/openwhisk/common/RunCliCmdTests.scala b/tests/src/test/scala/org/apache/openwhisk/common/RunCliCmdTests.scala index c4f2bc4233c..76ed75725bd 100644 --- a/tests/src/test/scala/org/apache/openwhisk/common/RunCliCmdTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/common/RunCliCmdTests.scala @@ -20,15 +20,16 @@ package org.apache.openwhisk.common import java.io.File import org.junit.runner.RunWith -import org.scalatest.{BeforeAndAfterEach, FlatSpec} -import org.scalatest.junit.JUnitRunner +import org.scalatest.BeforeAndAfterEach +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner import common.RunCliCmd import common.TestUtils._ import scala.collection.mutable.Buffer @RunWith(classOf[JUnitRunner]) -class RunCliCmdTests extends FlatSpec with RunCliCmd with BeforeAndAfterEach { +class RunCliCmdTests extends AnyFlatSpec with RunCliCmd with BeforeAndAfterEach { case class TestRunResult(code: Int) extends RunResult(code, "", "") val defaultRR = TestRunResult(0) diff --git a/tests/src/test/scala/org/apache/openwhisk/common/SchedulerTests.scala b/tests/src/test/scala/org/apache/openwhisk/common/SchedulerTests.scala index 549733a5a10..6e86541cace 100644 --- a/tests/src/test/scala/org/apache/openwhisk/common/SchedulerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/common/SchedulerTests.scala @@ -26,16 +26,16 @@ import scala.concurrent.duration._ import scala.language.postfixOps import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner -import akka.actor.PoisonPill +import org.apache.pekko.actor.PoisonPill import common.StreamLogging import common.WskActorSystem @RunWith(classOf[JUnitRunner]) -class SchedulerTests extends FlatSpec with Matchers with WskActorSystem with StreamLogging { +class SchedulerTests extends AnyFlatSpec with Matchers with WskActorSystem with StreamLogging { val timeBetweenCalls = 50 milliseconds val callsToProduce = 5 @@ -71,7 +71,7 @@ class SchedulerTests extends FlatSpec with Matchers with WskActorSystem with Str waitForCalls() // This is equal to a scheduled ! PoisonPill val shutdownTimeout = 10.seconds - Await.result(akka.pattern.gracefulStop(scheduled, shutdownTimeout, PoisonPill), shutdownTimeout) + Await.result(org.apache.pekko.pattern.gracefulStop(scheduled, shutdownTimeout, PoisonPill), shutdownTimeout) val countAfterKill = callCount callCount should be >= callsToProduce @@ -152,7 +152,7 @@ class SchedulerTests extends FlatSpec with Matchers with WskActorSystem with Str val scheduled = Scheduler.scheduleWaitAtMost(timeBetweenCalls) { () => calls += Instant.now - akka.pattern.after(computationTime, actorSystem.scheduler)(Future.successful(true)) + org.apache.pekko.pattern.after(computationTime, actorSystem.scheduler)(Future.successful(true)) } waitForCalls(interval = timeBetweenCalls) @@ -215,7 +215,7 @@ class SchedulerTests extends FlatSpec with Matchers with WskActorSystem with Str val scheduled = Scheduler.scheduleWaitAtMost(timeBetweenCalls) { () => calls += Instant.now - akka.pattern.after(computationTime, actorSystem.scheduler)(Future.successful(true)) + org.apache.pekko.pattern.after(computationTime, actorSystem.scheduler)(Future.successful(true)) } waitForCalls(interval = timeBetweenCalls) diff --git a/tests/src/test/scala/org/apache/openwhisk/common/TransactionIdTests.scala b/tests/src/test/scala/org/apache/openwhisk/common/TransactionIdTests.scala index a81b7c71b94..0dffe0c4e83 100644 --- a/tests/src/test/scala/org/apache/openwhisk/common/TransactionIdTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/common/TransactionIdTests.scala @@ -21,11 +21,12 @@ import java.time.{Instant} import spray.json._ import common.StreamLogging import org.junit.runner.RunWith -import org.scalatest.{FlatSpec, Matchers} -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -class TransactionIdTests extends FlatSpec with Matchers with StreamLogging { +class TransactionIdTests extends AnyFlatSpec with Matchers with StreamLogging { behavior of "TransactionId deserialization" diff --git a/tests/src/test/scala/org/apache/openwhisk/common/UserEventTests.scala b/tests/src/test/scala/org/apache/openwhisk/common/UserEventTests.scala index 9a8e0c275f0..25d490132ed 100644 --- a/tests/src/test/scala/org/apache/openwhisk/common/UserEventTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/common/UserEventTests.scala @@ -19,12 +19,14 @@ package org.apache.openwhisk.common import java.nio.charset.StandardCharsets -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import common._ import common.rest.WskRestOperations import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import org.apache.openwhisk.connector.kafka.KafkaConsumerConnector import org.apache.openwhisk.core.WhiskConfig import org.apache.openwhisk.core.connector.{Activation, EventMessage, Metric} @@ -32,7 +34,7 @@ import org.apache.openwhisk.core.connector.{Activation, EventMessage, Metric} import scala.concurrent.duration._ @RunWith(classOf[JUnitRunner]) -class UserEventTests extends FlatSpec with Matchers with WskTestHelpers with StreamLogging with BeforeAndAfterAll { +class UserEventTests extends AnyFlatSpec with Matchers with WskTestHelpers with StreamLogging with BeforeAndAfterAll { implicit val wskprops = WskProps() implicit val system = ActorSystem("UserEventTestSystem") diff --git a/tests/src/test/scala/org/apache/openwhisk/common/etcd/EtcdConfigTests.scala b/tests/src/test/scala/org/apache/openwhisk/common/etcd/EtcdConfigTests.scala index 0d56214293e..4389dae8f38 100644 --- a/tests/src/test/scala/org/apache/openwhisk/common/etcd/EtcdConfigTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/common/etcd/EtcdConfigTests.scala @@ -20,12 +20,13 @@ package org.apache.openwhisk.common.etcd import common.WskActorSystem import org.apache.openwhisk.core.etcd.{EtcdClient, EtcdConfig} import org.junit.runner.RunWith -import org.scalatest.{FlatSpec, Matchers} -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import scala.concurrent.ExecutionContextExecutor @RunWith(classOf[JUnitRunner]) -class EtcdConfigTests extends FlatSpec with Matchers with WskActorSystem { +class EtcdConfigTests extends AnyFlatSpec with Matchers with WskActorSystem { behavior of "EtcdConfig" implicit val ece: ExecutionContextExecutor = actorSystem.dispatcher diff --git a/tests/src/test/scala/org/apache/openwhisk/common/etcd/EtcdKvTests.scala b/tests/src/test/scala/org/apache/openwhisk/common/etcd/EtcdKvTests.scala index a93cda0ea4d..7128aad182d 100644 --- a/tests/src/test/scala/org/apache/openwhisk/common/etcd/EtcdKvTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/common/etcd/EtcdKvTests.scala @@ -23,12 +23,13 @@ import org.apache.openwhisk.core.entity.size._ import org.apache.openwhisk.core.etcd.EtcdKV.InvokerKeys import org.junit.runner.RunWith import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import pureconfig.loadConfigOrThrow @RunWith(classOf[JUnitRunner]) -class EtcdKvTests extends FlatSpec with ScalaFutures with Matchers { +class EtcdKvTests extends AnyFlatSpec with ScalaFutures with Matchers { behavior of "InvokerKeys" diff --git a/tests/src/test/scala/org/apache/openwhisk/common/etcd/EtcdLeaderShipUnitTests.scala b/tests/src/test/scala/org/apache/openwhisk/common/etcd/EtcdLeaderShipUnitTests.scala index 5285c6d9bef..707bede2b4f 100644 --- a/tests/src/test/scala/org/apache/openwhisk/common/etcd/EtcdLeaderShipUnitTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/common/etcd/EtcdLeaderShipUnitTests.scala @@ -33,14 +33,20 @@ import org.apache.openwhisk.core.service.Lease import org.junit.runner.RunWith import org.scalatest.concurrent.PatienceConfiguration.Timeout import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import scala.concurrent.duration._ import scala.concurrent.{ExecutionContextExecutor, Future} @RunWith(classOf[JUnitRunner]) -class EtcdLeaderShipUnitTests extends FlatSpec with ScalaFutures with Matchers with WskActorSystem with StreamLogging { +class EtcdLeaderShipUnitTests + extends AnyFlatSpec + with ScalaFutures + with Matchers + with WskActorSystem + with StreamLogging { implicit val timeout = Timeout(2.seconds) private val leaderKey = "openwhiskleader" diff --git a/tests/src/test/scala/org/apache/openwhisk/common/etcd/EtcdWorkerTests.scala b/tests/src/test/scala/org/apache/openwhisk/common/etcd/EtcdWorkerTests.scala index c5fcb8073f1..5c1172f8c92 100644 --- a/tests/src/test/scala/org/apache/openwhisk/common/etcd/EtcdWorkerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/common/etcd/EtcdWorkerTests.scala @@ -17,9 +17,9 @@ package org.apache.openwhisk.common.etcd -import akka.actor.{ActorRef, ActorSystem} -import akka.testkit.{ImplicitSender, TestActor, TestActorRef, TestKit, TestProbe} -import akka.util.Timeout +import org.apache.pekko.actor.{ActorRef, ActorSystem} +import org.apache.pekko.testkit.{ImplicitSender, TestActor, TestActorRef, TestKit, TestProbe} +import org.apache.pekko.util.Timeout import com.ibm.etcd.api.{DeleteRangeResponse, PutResponse, TxnResponse} import common.StreamLogging import io.grpc.{Status, StatusRuntimeException} @@ -40,9 +40,11 @@ import org.apache.openwhisk.core.service.{ } import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory -import org.scalatest.{BeforeAndAfterAll, FlatSpecLike, Matchers} +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import scala.concurrent.{ExecutionContext, Future} import scala.concurrent.duration._ @@ -51,7 +53,7 @@ import scala.concurrent.duration._ class EtcdWorkerTests extends TestKit(ActorSystem("EtcdWorker")) with ImplicitSender - with FlatSpecLike + with AnyFlatSpecLike with ScalaFutures with Matchers with MockFactory diff --git a/tests/src/test/scala/org/apache/openwhisk/connector/kafka/KafkaMetricsTests.scala b/tests/src/test/scala/org/apache/openwhisk/connector/kafka/KafkaMetricsTests.scala index 81c00a4da6c..ae292d72019 100644 --- a/tests/src/test/scala/org/apache/openwhisk/connector/kafka/KafkaMetricsTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/connector/kafka/KafkaMetricsTests.scala @@ -17,14 +17,15 @@ package org.apache.openwhisk.connector.kafka -import akka.http.scaladsl.testkit.ScalatestRouteTest -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.testkit.ScalatestRouteTest +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ import org.apache.kafka.common.MetricName import org.apache.kafka.common.metrics.{KafkaMetric, Measurable, MetricConfig} import org.apache.kafka.common.utils.Time import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import spray.json._ import spray.json.DefaultJsonProtocol._ @@ -32,7 +33,7 @@ import scala.collection.JavaConverters._ import scala.concurrent.Future @RunWith(classOf[JUnitRunner]) -class KafkaMetricsTests extends FlatSpec with Matchers with ScalatestRouteTest { +class KafkaMetricsTests extends AnyFlatSpec with Matchers with ScalatestRouteTest { behavior of "KafkaMetrics" it should "render metrics as json" in { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/WhiskConfigTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/WhiskConfigTests.scala index 3324ced55db..3745e84bff3 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/WhiskConfigTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/WhiskConfigTests.scala @@ -22,14 +22,14 @@ import java.io.File import java.io.FileWriter import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import common.StreamLogging @RunWith(classOf[JUnitRunner]) -class WhiskConfigTests extends FlatSpec with Matchers with StreamLogging { +class WhiskConfigTests extends AnyFlatSpec with Matchers with StreamLogging { behavior of "WhiskConfig" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/admin/WskAdminTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/admin/WskAdminTests.scala index ca55dd8ed98..94f5e84b9c5 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/admin/WskAdminTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/admin/WskAdminTests.scala @@ -21,8 +21,9 @@ import common.WskAdmin.wskadmin import common._ import common.rest.WskRestOperations import org.junit.runner.RunWith -import org.scalatest.{BeforeAndAfterAll, Matchers} -import org.scalatest.junit.JUnitRunner +import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import org.apache.openwhisk.core.entity.{BasicAuthenticationAuthKey, Subject} import common.TestHelpers diff --git a/tests/src/test/scala/org/apache/openwhisk/core/apigw/actions/test/ApiGwRestRoutemgmtActionTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/apigw/actions/test/ApiGwRestRoutemgmtActionTests.scala index d43a8a18d2f..5ae87a5c3bd 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/apigw/actions/test/ApiGwRestRoutemgmtActionTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/apigw/actions/test/ApiGwRestRoutemgmtActionTests.scala @@ -18,7 +18,7 @@ package org.apache.openwhisk.core.apigw.actions.test import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common.rest.WskRestOperations diff --git a/tests/src/test/scala/org/apache/openwhisk/core/apigw/actions/test/ApiGwRoutemgmtActionTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/apigw/actions/test/ApiGwRoutemgmtActionTests.scala index b2c053b61e0..feb9730f2f9 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/apigw/actions/test/ApiGwRoutemgmtActionTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/apigw/actions/test/ApiGwRoutemgmtActionTests.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.core.apigw.actions.test import org.junit.runner.RunWith import org.scalatest.BeforeAndAfterAll -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common.JsHelpers import common.StreamLogging diff --git a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/ApiGwRestBasicTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/ApiGwRestBasicTests.scala index 3d5306aab04..20f58d81d99 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/ApiGwRestBasicTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/ApiGwRestBasicTests.scala @@ -22,7 +22,7 @@ import java.io.BufferedWriter import java.io.FileWriter import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import org.apache.commons.io.FileUtils import common.TestUtils._ import common.TestUtils diff --git a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/ApiGwRestTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/ApiGwRestTests.scala index fad4158b3b5..6dd1e61a6e8 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/ApiGwRestTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/ApiGwRestTests.scala @@ -17,9 +17,9 @@ package org.apache.openwhisk.core.cli.test -import akka.http.scaladsl.model.StatusCodes.OK +import org.apache.pekko.http.scaladsl.model.StatusCodes.OK import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import spray.json.JsObject import spray.json._ import common.rest.WskRestOperations diff --git a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/BaseApiGwTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/BaseApiGwTests.scala index dc30f1bd876..6b75bed6aee 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/BaseApiGwTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/BaseApiGwTests.scala @@ -28,7 +28,7 @@ import org.junit.runner.RunWith import org.scalatest.BeforeAndAfterAll import org.scalatest.BeforeAndAfterEach -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common.TestHelpers import common.TestUtils._ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskActionSequenceTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskActionSequenceTests.scala index 01906b9a27e..16319cf93cf 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskActionSequenceTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskActionSequenceTests.scala @@ -18,7 +18,7 @@ package org.apache.openwhisk.core.cli.test import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common.TestHelpers import common.TestUtils diff --git a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskEntitlementTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskEntitlementTests.scala index f20a044d9ad..bdb781ef12c 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskEntitlementTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskEntitlementTests.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.core.cli.test import org.junit.runner.RunWith import org.scalatest.BeforeAndAfterAll -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common.TestHelpers import common.TestUtils diff --git a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskRestActionSequenceTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskRestActionSequenceTests.scala index 0634dbac844..99aa4cf2faf 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskRestActionSequenceTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskRestActionSequenceTests.scala @@ -18,7 +18,7 @@ package org.apache.openwhisk.core.cli.test import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import spray.json._ import common.rest.WskRestOperations import common.rest.RestResult diff --git a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskRestBasicUsageTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskRestBasicUsageTests.scala index 8df5ad7babe..6634256c19e 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskRestBasicUsageTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskRestBasicUsageTests.scala @@ -17,10 +17,10 @@ package org.apache.openwhisk.core.cli.test -import akka.http.scaladsl.model.StatusCodes.NotFound -import akka.http.scaladsl.model.StatusCodes.OK -import akka.http.scaladsl.model.StatusCodes.BadRequest -import akka.http.scaladsl.model.StatusCodes.Conflict +import org.apache.pekko.http.scaladsl.model.StatusCodes.NotFound +import org.apache.pekko.http.scaladsl.model.StatusCodes.OK +import org.apache.pekko.http.scaladsl.model.StatusCodes.BadRequest +import org.apache.pekko.http.scaladsl.model.StatusCodes.Conflict import java.time.Instant import java.time.Clock @@ -28,7 +28,7 @@ import scala.language.postfixOps import scala.concurrent.duration.DurationInt import scala.util.Random import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common.TestHelpers import common.TestUtils import common.TestUtils._ @@ -42,12 +42,20 @@ import spray.json._ import org.apache.openwhisk.core.entity._ import org.apache.openwhisk.core.entity.size.SizeInt import TestJsonArgs._ -import akka.http.scaladsl.Http -import akka.http.scaladsl.model.HttpMethods.POST -import akka.http.scaladsl.model.{ContentTypes, HttpEntity, HttpHeader, HttpMethod, HttpRequest, HttpResponse, Uri} -import akka.http.scaladsl.model.Uri.{Path, Query} -import akka.http.scaladsl.model.headers.{Authorization, BasicHttpCredentials, RawHeader} -import akka.util.ByteString +import org.apache.pekko.http.scaladsl.Http +import org.apache.pekko.http.scaladsl.model.HttpMethods.POST +import org.apache.pekko.http.scaladsl.model.{ + ContentTypes, + HttpEntity, + HttpHeader, + HttpMethod, + HttpRequest, + HttpResponse, + Uri +} +import org.apache.pekko.http.scaladsl.model.Uri.{Path, Query} +import org.apache.pekko.http.scaladsl.model.headers.{Authorization, BasicHttpCredentials, RawHeader} +import org.apache.pekko.util.ByteString import org.apache.openwhisk.http.Messages /** diff --git a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskRestEntitlementTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskRestEntitlementTests.scala index c78c6fd0545..19dbd89edfd 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskRestEntitlementTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskRestEntitlementTests.scala @@ -17,11 +17,11 @@ package org.apache.openwhisk.core.cli.test -import akka.http.scaladsl.model.StatusCodes.BadGateway -import akka.http.scaladsl.model.StatusCodes.Forbidden -import akka.http.scaladsl.model.StatusCodes.NotFound +import org.apache.pekko.http.scaladsl.model.StatusCodes.BadGateway +import org.apache.pekko.http.scaladsl.model.StatusCodes.Forbidden +import org.apache.pekko.http.scaladsl.model.StatusCodes.NotFound import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common.rest.WskRestOperations import common.rest.RestResult import common.TestUtils.RunResult diff --git a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskWebActionsTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskWebActionsTests.scala index e4f519c1149..c31d4fc2155 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskWebActionsTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskWebActionsTests.scala @@ -22,7 +22,7 @@ import java.util.Base64 import scala.util.Failure import scala.util.Try import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import io.restassured.RestAssured import io.restassured.http.Header import common._ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/connector/test/EventMessageTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/connector/test/EventMessageTests.scala index 73a2840340f..a47043016e2 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/connector/test/EventMessageTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/connector/test/EventMessageTests.scala @@ -21,8 +21,9 @@ import java.time.Instant import java.util.concurrent.TimeUnit import org.junit.runner.RunWith -import org.scalatest.{FlatSpec, Matchers} -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import spray.json._ import spray.json.DefaultJsonProtocol._ import org.apache.openwhisk.core.connector.Activation @@ -36,7 +37,7 @@ import scala.util.Success * Unit tests for the EventMessage objects. */ @RunWith(classOf[JUnitRunner]) -class EventMessageTests extends FlatSpec with Matchers { +class EventMessageTests extends AnyFlatSpec with Matchers { behavior of "Activation" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/connector/test/MessageFeedTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/connector/test/MessageFeedTests.scala index 9e7e56611a0..1e66b25e4a8 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/connector/test/MessageFeedTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/connector/test/MessageFeedTests.scala @@ -26,19 +26,19 @@ import scala.concurrent.duration._ import org.junit.runner.RunWith import org.scalatest.BeforeAndAfterAll import org.scalatest.BeforeAndAfterEach -import org.scalatest.FlatSpecLike -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner - -import akka.actor.ActorRef -import akka.actor.ActorSystem -import akka.actor.FSM -import akka.actor.FSM.CurrentState -import akka.actor.FSM.SubscribeTransitionCallBack -import akka.actor.FSM.Transition -import akka.actor.PoisonPill -import akka.actor.Props -import akka.testkit.TestKit +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner + +import org.apache.pekko.actor.ActorRef +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.actor.FSM +import org.apache.pekko.actor.FSM.CurrentState +import org.apache.pekko.actor.FSM.SubscribeTransitionCallBack +import org.apache.pekko.actor.FSM.Transition +import org.apache.pekko.actor.PoisonPill +import org.apache.pekko.actor.Props +import org.apache.pekko.testkit.TestKit import common.StreamLogging import org.apache.openwhisk.core.connector._ import org.apache.openwhisk.core.connector.MessageFeed._ @@ -46,7 +46,7 @@ import org.apache.openwhisk.utils.retry @RunWith(classOf[JUnitRunner]) class MessageFeedTests - extends FlatSpecLike + extends AnyFlatSpecLike with Matchers with BeforeAndAfterEach with BeforeAndAfterAll diff --git a/tests/src/test/scala/org/apache/openwhisk/core/connector/test/MessageTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/connector/test/MessageTests.scala index 2806c0cfb60..e7b6e586b06 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/connector/test/MessageTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/connector/test/MessageTests.scala @@ -17,18 +17,19 @@ package org.apache.openwhisk.core.connector.test -import akka.actor.ActorSystem -import akka.testkit.TestKit +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.testkit.TestKit import org.apache.openwhisk.common.InvokerState.{Healthy, Unhealthy} import org.apache.openwhisk.core.connector.InvokerResourceMessage import org.apache.openwhisk.core.entity.SchedulerInstanceId import org.apache.openwhisk.core.scheduler.{SchedulerEndpoints, SchedulerStates} import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpecLike, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers @RunWith(classOf[JUnitRunner]) -class MessageTests extends TestKit(ActorSystem("Message")) with FlatSpecLike with Matchers { +class MessageTests extends TestKit(ActorSystem("Message")) with AnyFlatSpecLike with Matchers { behavior of "Message" it should "be able to compare the InvokerResourceMessage" in { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/connector/tests/AcknowledgementMessageTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/connector/tests/AcknowledgementMessageTests.scala index 33f52e394ac..36f59a246c8 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/connector/tests/AcknowledgementMessageTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/connector/tests/AcknowledgementMessageTests.scala @@ -18,8 +18,9 @@ package org.apache.openwhisk.core.connector.tests import org.junit.runner.RunWith -import org.scalatest.{FlatSpec, Matchers} -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import spray.json._ import org.apache.openwhisk.common.{TransactionId, WhiskInstants} import org.apache.openwhisk.core.connector.{ @@ -38,7 +39,7 @@ import scala.util.Success * Unit tests for the AcknowledgementMessageTests object. */ @RunWith(classOf[JUnitRunner]) -class AcknowledgementMessageTests extends FlatSpec with Matchers with WhiskInstants { +class AcknowledgementMessageTests extends AnyFlatSpec with Matchers with WhiskInstants { behavior of "acknowledgement message" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/AkkaContainerClientTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/AkkaContainerClientTests.scala index b0ff478f01a..563ee0a9f5b 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/AkkaContainerClientTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/AkkaContainerClientTests.scala @@ -30,25 +30,25 @@ import org.apache.http.protocol.HttpRequestHandler import org.junit.runner.RunWith import org.scalatest.BeforeAndAfter import org.scalatest.BeforeAndAfterAll -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import scala.concurrent.Await import scala.concurrent.TimeoutException import scala.concurrent.duration._ import spray.json.JsObject import org.apache.openwhisk.common.TransactionId -import org.apache.openwhisk.core.containerpool.AkkaContainerClient +import org.apache.openwhisk.core.containerpool.PekkoContainerClient import org.apache.openwhisk.core.containerpool.ContainerHealthError import org.apache.openwhisk.core.entity.ActivationResponse._ import org.apache.openwhisk.core.entity.size._ /** - * Unit tests for AkkaContainerClientTests which communicate with containers. + * Unit tests for PekkoContainerClientTests which communicate with containers. */ @RunWith(classOf[JUnitRunner]) -class AkkaContainerClientTests - extends FlatSpec +class PekkoContainerClientTests + extends AnyFlatSpec with Matchers with BeforeAndAfter with BeforeAndAfterAll @@ -105,11 +105,11 @@ class AkkaContainerClientTests mockServer.shutDown() } - behavior of "AkkaContainerClient" + behavior of "PekkoContainerClient" it should "not wait longer than set timeout" in { val timeout = 5.seconds - val connection = new AkkaContainerClient(httpHost.getHostName, httpHost.getPort, timeout, 100) + val connection = new PekkoContainerClient(httpHost.getHostName, httpHost.getPort, timeout, 100) testHang = timeout * 2 val start = Instant.now() val result = Await.result(connection.post("/init", JsObject.empty, 1.B, 1.B, retry = true), 10.seconds) @@ -123,7 +123,7 @@ class AkkaContainerClientTests it should "handle empty entity response" in { val timeout = 5.seconds - val connection = new AkkaContainerClient(httpHost.getHostName, httpHost.getPort, timeout, 100) + val connection = new PekkoContainerClient(httpHost.getHostName, httpHost.getPort, timeout, 100) testStatusCode = 204 val result = Await.result(connection.post("/init", JsObject.empty, 1.B, 1.B, retry = true), 10.seconds) result shouldBe Left(NoResponseReceived()) @@ -131,7 +131,7 @@ class AkkaContainerClientTests it should "retry till timeout on StreamTcpException" in { val timeout = 5.seconds - val connection = new AkkaContainerClient("0.0.0.0", 12345, timeout, 100) + val connection = new PekkoContainerClient("0.0.0.0", 12345, timeout, 100) val start = Instant.now() val result = Await.result(connection.post("/init", JsObject.empty, 1.B, 1.B, retry = true), 10.seconds) val end = Instant.now() @@ -146,7 +146,7 @@ class AkkaContainerClientTests it should "throw ContainerHealthError on HttpHostConnectException if reschedule==true" in { val timeout = 5.seconds - val connection = new AkkaContainerClient("0.0.0.0", 12345, timeout, 100) + val connection = new PekkoContainerClient("0.0.0.0", 12345, timeout, 100) assertThrows[ContainerHealthError] { Await.result(connection.post("/run", JsObject.empty, 1.B, 1.B, retry = false, reschedule = true), 10.seconds) } @@ -156,7 +156,7 @@ class AkkaContainerClientTests val timeout = 5.seconds val retryInterval = 500.milliseconds val connection = - new AkkaContainerClient(httpHost.getHostName, httpHost.getPort, timeout, 100, retryInterval) + new PekkoContainerClient(httpHost.getHostName, httpHost.getPort, timeout, 100, retryInterval) val start = Instant.now() testConnectionFailCount = 5 testResponse = "" @@ -173,7 +173,7 @@ class AkkaContainerClientTests it should "not truncate responses within limit" in { val timeout = 1.minute.toMillis - val connection = new AkkaContainerClient(httpHost.getHostName, httpHost.getPort, timeout.millis, 100) + val connection = new PekkoContainerClient(httpHost.getHostName, httpHost.getPort, timeout.millis, 100) Seq(true, false).foreach { success => Seq(null, "", "abc", """{"a":"B"}""", """["a", "b"]""").foreach { r => testStatusCode = if (success) 200 else 500 @@ -191,7 +191,7 @@ class AkkaContainerClientTests val limit = 2.B val truncationLimit = 1.B val connection = - new AkkaContainerClient(httpHost.getHostName, httpHost.getPort, timeout.millis, 100) + new PekkoContainerClient(httpHost.getHostName, httpHost.getPort, timeout.millis, 100) Seq(true, false).foreach { success => Seq("abc", """{"a":"B"}""", """["a", "b"]""").foreach { r => testStatusCode = if (success) 200 else 500 @@ -212,7 +212,7 @@ class AkkaContainerClientTests val limit = 300.KB val truncationLimit = 299.B val connection = - new AkkaContainerClient(httpHost.getHostName, httpHost.getPort, timeout.millis, 100) + new PekkoContainerClient(httpHost.getHostName, httpHost.getPort, timeout.millis, 100) Seq(true, false).foreach { success => // Generate a response that's 1MB val response = "0" * 1024 * 1024 diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/ApacheBlockingContainerClientTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/ApacheBlockingContainerClientTests.scala index 79774b2d5c4..c40fd8ee610 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/ApacheBlockingContainerClientTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/ApacheBlockingContainerClientTests.scala @@ -27,11 +27,11 @@ import org.apache.http.localserver.LocalServerTestBase import org.apache.http.protocol.HttpContext import org.apache.http.protocol.HttpRequestHandler import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import org.scalatest.BeforeAndAfter import org.scalatest.BeforeAndAfterAll -import org.scalatest.FlatSpec -import org.scalatest.Matchers +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import spray.json.JsObject import common.StreamLogging import common.WskActorSystem @@ -50,7 +50,7 @@ import org.apache.openwhisk.core.entity.ActivationResponse._ */ @RunWith(classOf[JUnitRunner]) class ApacheBlockingContainerClientTests - extends FlatSpec + extends AnyFlatSpec with Matchers with BeforeAndAfter with BeforeAndAfterAll diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/DockerClientTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/DockerClientTests.scala index d08e8fa376b..563c7a22510 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/DockerClientTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/DockerClientTests.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.containerpool.docker.test -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import java.util.concurrent.Semaphore import scala.concurrent.Await @@ -30,9 +30,9 @@ import scala.util.Success import org.junit.runner.RunWith import org.scalatest.BeforeAndAfterEach import org.scalatest.concurrent.Eventually -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner -import org.scalatest.Matchers +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.matchers.should.Matchers import org.scalatest.time.{Seconds, Span} import common.{StreamLogging, WskActorSystem} import org.apache.openwhisk.common.LogMarker @@ -45,7 +45,7 @@ import org.apache.openwhisk.utils.retry @RunWith(classOf[JUnitRunner]) class DockerClientTests - extends FlatSpec + extends AnyFlatSpec with Matchers with StreamLogging with BeforeAndAfterEach diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/DockerClientWithFileAccessTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/DockerClientWithFileAccessTests.scala index f21063d1d27..8bca6a45c8b 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/DockerClientWithFileAccessTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/DockerClientWithFileAccessTests.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.core.containerpool.docker.test import java.io.File -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import scala.concurrent.Await import scala.concurrent.ExecutionContext @@ -29,9 +29,9 @@ import scala.concurrent.duration.{Duration, DurationInt, FiniteDuration} import scala.language.reflectiveCalls import org.junit.runner.RunWith import org.scalatest.BeforeAndAfterEach -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner -import org.scalatest.Matchers +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.matchers.should.Matchers import common.{StreamLogging, WskActorSystem} import spray.json._ import spray.json.DefaultJsonProtocol._ @@ -42,7 +42,7 @@ import org.apache.openwhisk.core.containerpool.docker.DockerClientWithFileAccess @RunWith(classOf[JUnitRunner]) class DockerClientWithFileAccessTestsIp - extends FlatSpec + extends AnyFlatSpec with Matchers with StreamLogging with BeforeAndAfterEach @@ -115,7 +115,7 @@ class DockerClientWithFileAccessTestsIp @RunWith(classOf[JUnitRunner]) class DockerClientWithFileAccessTestsOom - extends FlatSpec + extends AnyFlatSpec with Matchers with StreamLogging with BeforeAndAfterEach diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/DockerContainerFactoryTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/DockerContainerFactoryTests.scala index feebd2f05bb..b0d6f59c5cd 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/DockerContainerFactoryTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/DockerContainerFactoryTests.scala @@ -23,9 +23,9 @@ import common.WskActorSystem import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory import org.scalatest.BeforeAndAfterEach -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import scala.concurrent.Await import scala.concurrent.Future @@ -49,7 +49,7 @@ import pureconfig.generic.auto._ @RunWith(classOf[JUnitRunner]) class DockerContainerFactoryTests - extends FlatSpec + extends AnyFlatSpec with Matchers with MockFactory with StreamLogging diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/DockerContainerTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/DockerContainerTests.scala index 25a63da55ee..a6a4e47ee58 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/DockerContainerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/DockerContainerTests.scala @@ -19,8 +19,8 @@ package org.apache.openwhisk.core.containerpool.docker.test import java.io.IOException import java.time.Instant -import akka.stream.scaladsl.{Sink, Source} -import akka.util.ByteString +import org.apache.pekko.stream.scaladsl.{Sink, Source} +import org.apache.pekko.util.ByteString import common.TimingHelpers import scala.collection.mutable @@ -30,10 +30,10 @@ import scala.concurrent.Future import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory import org.scalatest.BeforeAndAfterEach -import org.scalatest.FlatSpec +import org.scalatest.flatspec.AnyFlatSpec import org.apache.openwhisk.core.containerpool.logging.{DockerToActivationLogStore, LogLine} -import org.scalatest.junit.JUnitRunner -import org.scalatest.Matchers +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.matchers.should.Matchers import common.{StreamLogging, WskActorSystem} import spray.json._ import org.apache.openwhisk.common.LoggingMarkers._ @@ -75,7 +75,7 @@ object DockerContainerTests { */ @RunWith(classOf[JUnitRunner]) class DockerContainerTests - extends FlatSpec + extends AnyFlatSpec with Matchers with MockFactory with StreamLogging diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/ProcessRunnerTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/ProcessRunnerTests.scala index 359d00666b0..59a03a1da0c 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/ProcessRunnerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/ProcessRunnerTests.scala @@ -17,25 +17,25 @@ package org.apache.openwhisk.core.containerpool.docker.test -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import common.WskActorSystem import scala.concurrent.Future import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner import org.apache.openwhisk.core.containerpool.docker._ import scala.concurrent.ExecutionContext import scala.concurrent.duration._ import scala.concurrent.Await -import org.scalatest.Matchers +import org.scalatest.matchers.should.Matchers import scala.language.reflectiveCalls // Needed to invoke run() method of structural ProcessRunner extension @RunWith(classOf[JUnitRunner]) -class ProcessRunnerTests extends FlatSpec with Matchers with WskActorSystem { +class ProcessRunnerTests extends AnyFlatSpec with Matchers with WskActorSystem { def await[A](f: Future[A], timeout: FiniteDuration = 2.seconds) = Await.result(f, timeout) diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/RuncClientTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/RuncClientTests.scala index b8c1a41c6b1..d3e7e5739d1 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/RuncClientTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/RuncClientTests.scala @@ -17,17 +17,17 @@ package org.apache.openwhisk.core.containerpool.docker.test -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import scala.concurrent.Future import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.ExecutionContext import scala.concurrent.duration._ -import org.scalatest.Matchers +import org.scalatest.matchers.should.Matchers import org.apache.openwhisk.core.containerpool.docker.RuncClient import common.{StreamLogging, WskActorSystem} import org.apache.openwhisk.core.containerpool.ContainerId @@ -39,7 +39,7 @@ import org.apache.openwhisk.common.LoggingMarkers.INVOKER_RUNC_CMD @RunWith(classOf[JUnitRunner]) class RuncClientTests - extends FlatSpec + extends AnyFlatSpec with Matchers with StreamLogging with BeforeAndAfterEach diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/kubernetes/test/Fabric8ClientTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/kubernetes/test/Fabric8ClientTests.scala index 19522c98807..c84168288a8 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/kubernetes/test/Fabric8ClientTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/kubernetes/test/Fabric8ClientTests.scala @@ -29,14 +29,15 @@ import org.apache.openwhisk.core.containerpool.kubernetes._ import org.apache.openwhisk.core.entity.size._ import org.junit.runner.RunWith import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import scala.concurrent.duration._ @RunWith(classOf[JUnitRunner]) class Fabric8ClientTests - extends FlatSpec + extends AnyFlatSpec with Matchers with WskActorSystem with ScalaFutures diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/kubernetes/test/KubernetesClientTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/kubernetes/test/KubernetesClientTests.scala index 53e634cbba3..20c6455d4a1 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/kubernetes/test/KubernetesClientTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/kubernetes/test/KubernetesClientTests.scala @@ -19,8 +19,8 @@ package org.apache.openwhisk.core.containerpool.kubernetes.test import java.time.Instant -import akka.actor.ActorSystem -import akka.stream.scaladsl.{Concat, Sink, Source} +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream.scaladsl.{Concat, Sink, Source} import scala.concurrent.Await import scala.concurrent.ExecutionContext @@ -29,9 +29,9 @@ import scala.concurrent.duration._ import org.junit.runner.RunWith import org.scalatest.BeforeAndAfterEach import org.scalatest.concurrent.Eventually -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner -import org.scalatest.Matchers +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.matchers.should.Matchers import org.scalatest.time.{Seconds, Span} import common.{StreamLogging, WskActorSystem} import okio.Buffer @@ -47,7 +47,7 @@ import scala.collection.immutable.Queue @RunWith(classOf[JUnitRunner]) class KubernetesClientTests - extends FlatSpec + extends AnyFlatSpec with Matchers with StreamLogging with BeforeAndAfterEach diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/kubernetes/test/KubernetesContainerTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/kubernetes/test/KubernetesContainerTests.scala index c471de62638..420edaa1396 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/kubernetes/test/KubernetesContainerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/kubernetes/test/KubernetesContainerTests.scala @@ -20,9 +20,9 @@ package org.apache.openwhisk.core.containerpool.kubernetes.test import java.io.IOException import java.time.{Instant, ZoneId} -import akka.NotUsed -import akka.stream.scaladsl.{Flow, Sink, Source} -import akka.util.ByteString +import org.apache.pekko.NotUsed +import org.apache.pekko.stream.scaladsl.{Flow, Sink, Source} +import org.apache.pekko.util.ByteString import common.TimingHelpers import scala.concurrent.Await @@ -31,9 +31,9 @@ import scala.concurrent.Future import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory import org.scalatest.BeforeAndAfterEach -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner -import org.scalatest.Matchers +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.matchers.should.Matchers import common.{StreamLogging, WskActorSystem} import spray.json._ import org.apache.openwhisk.common.LoggingMarkers._ @@ -59,7 +59,7 @@ import scala.collection.mutable */ @RunWith(classOf[JUnitRunner]) class KubernetesContainerTests - extends FlatSpec + extends AnyFlatSpec with Matchers with MockFactory with StreamLogging diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/kubernetes/test/WhiskPodBuilderTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/kubernetes/test/WhiskPodBuilderTests.scala index ea7be1b9a14..3c4df3cf885 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/kubernetes/test/WhiskPodBuilderTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/kubernetes/test/WhiskPodBuilderTests.scala @@ -38,14 +38,15 @@ import org.apache.openwhisk.core.containerpool.kubernetes.{ } import org.apache.openwhisk.core.entity.size._ import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import scala.collection.JavaConverters._ import scala.concurrent.duration._ @RunWith(classOf[JUnitRunner]) -class WhiskPodBuilderTests extends FlatSpec with Matchers with KubeClientSupport { +class WhiskPodBuilderTests extends AnyFlatSpec with Matchers with KubeClientSupport { implicit val tid: TransactionId = TransactionId.testing private val testImage = "nodejs" private val memLimit = 10.MB diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/ElasticSearchLogStoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/ElasticSearchLogStoreTests.scala index dcdcb9b422e..519e43cc929 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/ElasticSearchLogStoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/ElasticSearchLogStoreTests.scala @@ -19,18 +19,20 @@ package org.apache.openwhisk.core.containerpool.logging import java.time.ZonedDateTime -import akka.NotUsed -import akka.actor.ActorSystem -import akka.http.scaladsl.model.HttpMethods.{GET, POST} -import akka.http.scaladsl.model._ -import akka.http.scaladsl.model.headers.{Accept, RawHeader} -import akka.stream.scaladsl.Flow -import akka.testkit.TestKit +import org.apache.pekko.NotUsed +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model.HttpMethods.{GET, POST} +import org.apache.pekko.http.scaladsl.model._ +import org.apache.pekko.http.scaladsl.model.headers.{Accept, RawHeader} +import org.apache.pekko.stream.scaladsl.Flow +import org.apache.pekko.testkit.TestKit import common.StreamLogging import org.junit.runner.RunWith import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, FlatSpecLike, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import pureconfig.error.ConfigReaderException import spray.json._ import org.apache.openwhisk.core.entity._ @@ -44,7 +46,7 @@ import scala.util.{Success, Try} @RunWith(classOf[JUnitRunner]) class ElasticSearchLogStoreTests extends TestKit(ActorSystem("ElasticSearchLogStore")) - with FlatSpecLike + with AnyFlatSpecLike with Matchers with BeforeAndAfterAll with ScalaFutures diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/ElasticSearchRestClientTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/ElasticSearchRestClientTests.scala index c3c34cbadeb..a3b3b7d20fe 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/ElasticSearchRestClientTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/ElasticSearchRestClientTests.scala @@ -19,16 +19,18 @@ package org.apache.openwhisk.core.containerpool.logging import spray.json._ import org.junit.runner.RunWith -import org.scalatest.{BeforeAndAfterAll, FlatSpecLike, Matchers} +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import akka.NotUsed -import akka.actor.ActorSystem -import akka.http.scaladsl.model._ -import akka.http.scaladsl.model.headers.Accept -import akka.stream.scaladsl.Flow -import akka.testkit.TestKit -import akka.http.scaladsl.model.HttpMethods.POST +import org.scalatestplus.junit.JUnitRunner +import org.apache.pekko.NotUsed +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model._ +import org.apache.pekko.http.scaladsl.model.headers.Accept +import org.apache.pekko.stream.scaladsl.Flow +import org.apache.pekko.testkit.TestKit +import org.apache.pekko.http.scaladsl.model.HttpMethods.POST import common.StreamLogging import org.apache.openwhisk.core.containerpool.logging.ElasticSearchJsonProtocol._ @@ -39,7 +41,7 @@ import scala.util.{Success, Try} @RunWith(classOf[JUnitRunner]) class ElasticSearchRestClientTests extends TestKit(ActorSystem("ElasticSearchRestClient")) - with FlatSpecLike + with AnyFlatSpecLike with Matchers with BeforeAndAfterAll with ScalaFutures diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/LogDriverLogStoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/LogDriverLogStoreTests.scala index 0f92bf9ab7e..1a78104ee87 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/LogDriverLogStoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/LogDriverLogStoreTests.scala @@ -17,17 +17,19 @@ package org.apache.openwhisk.core.containerpool.logging -import akka.actor.ActorSystem -import akka.testkit.TestKit +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.testkit.TestKit import org.junit.runner.RunWith -import org.scalatest.{BeforeAndAfterAll, FlatSpecLike, Matchers} -import org.scalatest.junit.JUnitRunner +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import org.apache.openwhisk.core.containerpool.ContainerArgsConfig @RunWith(classOf[JUnitRunner]) class LogDriverLogStoreTests extends TestKit(ActorSystem("LogDriverLogStore")) - with FlatSpecLike + with AnyFlatSpecLike with Matchers with BeforeAndAfterAll { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/SplunkLogStoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/SplunkLogStoreTests.scala index 0109fa4f3b8..7028b917594 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/SplunkLogStoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/SplunkLogStoreTests.scala @@ -19,20 +19,22 @@ package org.apache.openwhisk.core.containerpool.logging import java.time.ZonedDateTime -import akka.NotUsed -import akka.actor.ActorSystem -import akka.http.javadsl.model.headers.Authorization -import akka.http.scaladsl.model.HttpMethods.POST -import akka.http.scaladsl.model._ -import akka.http.scaladsl.model.headers.RawHeader -import akka.http.scaladsl.unmarshalling.Unmarshal -import akka.stream.scaladsl.Flow -import akka.testkit.TestKit +import org.apache.pekko.NotUsed +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.javadsl.model.headers.Authorization +import org.apache.pekko.http.scaladsl.model.HttpMethods.POST +import org.apache.pekko.http.scaladsl.model._ +import org.apache.pekko.http.scaladsl.model.headers.RawHeader +import org.apache.pekko.http.scaladsl.unmarshalling.Unmarshal +import org.apache.pekko.stream.scaladsl.Flow +import org.apache.pekko.testkit.TestKit import common.StreamLogging import org.junit.runner.RunWith import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, FlatSpecLike, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import pureconfig.error.ConfigReaderException import spray.json._ import org.apache.openwhisk.core.entity._ @@ -46,7 +48,7 @@ import scala.util.{Failure, Success, Try} @RunWith(classOf[JUnitRunner]) class SplunkLogStoreTests extends TestKit(ActorSystem("SplunkLogStore")) - with FlatSpecLike + with AnyFlatSpecLike with Matchers with BeforeAndAfterAll with ScalaFutures diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/test/DockerToActivationFileLogStoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/test/DockerToActivationFileLogStoreTests.scala index 2fc7e2907b7..0e7da20560d 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/test/DockerToActivationFileLogStoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/test/DockerToActivationFileLogStoreTests.scala @@ -19,13 +19,13 @@ package org.apache.openwhisk.core.containerpool.logging.test import java.time.Instant -import akka.stream.scaladsl.{Flow, Sink, Source} -import akka.testkit.TestProbe -import akka.util.ByteString +import org.apache.pekko.stream.scaladsl.{Flow, Sink, Source} +import org.apache.pekko.testkit.TestProbe +import org.apache.pekko.util.ByteString import common.{StreamLogging, WskActorSystem} import org.junit.runner.RunWith -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import spray.json.DefaultJsonProtocol._ import spray.json._ import org.apache.openwhisk.common.TransactionId diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/test/DockerToActivationLogStoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/test/DockerToActivationLogStoreTests.scala index a5660f7df81..397ff4a489c 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/test/DockerToActivationLogStoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/logging/test/DockerToActivationLogStoreTests.scala @@ -17,11 +17,12 @@ package org.apache.openwhisk.core.containerpool.logging.test -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import common.{StreamLogging, WskActorSystem} import org.junit.runner.RunWith -import org.scalatest.{FlatSpec, Matchers} -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import org.apache.openwhisk.core.containerpool.logging.{ DockerToActivationLogStoreProvider, LogCollectingException, @@ -31,8 +32,8 @@ import org.apache.openwhisk.core.entity.ExecManifest.{ImageName, RuntimeManifest import org.apache.openwhisk.core.entity._ import java.time.Instant -import akka.stream.scaladsl.Source -import akka.util.ByteString +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.util.ByteString import spray.json._ import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.core.containerpool.{Container, ContainerAddress, ContainerId} @@ -42,7 +43,7 @@ import scala.concurrent.{Await, ExecutionContext, Future} import scala.concurrent.duration._ @RunWith(classOf[JUnitRunner]) -class DockerToActivationLogStoreTests extends FlatSpec with Matchers with WskActorSystem with StreamLogging { +class DockerToActivationLogStoreTests extends AnyFlatSpec with Matchers with WskActorSystem with StreamLogging { def await[T](future: Future[T]) = Await.result(future, 1.minute) val uuid = UUID() diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerArgsConfigTest.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerArgsConfigTest.scala index 96164f891e2..e30d4865b71 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerArgsConfigTest.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerArgsConfigTest.scala @@ -18,16 +18,16 @@ package org.apache.openwhisk.core.containerpool.test import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import pureconfig._ import pureconfig.generic.auto._ import org.apache.openwhisk.core.ConfigKeys import org.apache.openwhisk.core.containerpool.ContainerArgsConfig @RunWith(classOf[JUnitRunner]) -class ContainerArgsConfigTest extends FlatSpec with Matchers { +class ContainerArgsConfigTest extends AnyFlatSpec with Matchers { it should "use defaults for container args map" in { val config = loadConfigOrThrow[ContainerArgsConfig](ConfigKeys.containerArgs) diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerPoolConfigTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerPoolConfigTests.scala index 23e3a738e9f..b5d2b6f4907 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerPoolConfigTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerPoolConfigTests.scala @@ -21,13 +21,14 @@ import org.apache.openwhisk.core.containerpool.ContainerPoolConfig import org.apache.openwhisk.core.entity.ByteSize import org.apache.openwhisk.core.entity.size.SizeInt import org.junit.runner.RunWith -import org.scalatest.{FlatSpec, Matchers} -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import scala.concurrent.duration.DurationInt @RunWith(classOf[JUnitRunner]) -class ContainerPoolConfigTests extends FlatSpec with Matchers { +class ContainerPoolConfigTests extends AnyFlatSpec with Matchers { def createPoolConfig(userMemory: ByteSize, userCpus: Option[Double] = None): ContainerPoolConfig = { ContainerPoolConfig(userMemory, 0.5, false, 2.second, 10.seconds, None, 1, 3, false, 1.second, 10, userCpus) diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerPoolTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerPoolTests.scala index 6f041f8369c..e217f75ea05 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerPoolTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerPoolTests.scala @@ -26,15 +26,15 @@ import scala.concurrent.duration._ import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory import org.scalatest.BeforeAndAfterAll -import org.scalatest.FlatSpec -import org.scalatest.FlatSpecLike -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner -import akka.actor.ActorRefFactory -import akka.actor.ActorSystem -import akka.testkit.ImplicitSender -import akka.testkit.TestKit -import akka.testkit.TestProbe +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner +import org.apache.pekko.actor.ActorRefFactory +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.testkit.ImplicitSender +import org.apache.pekko.testkit.TestKit +import org.apache.pekko.testkit.TestProbe import common.{StreamLogging, WhiskProperties} import org.apache.openwhisk.common.{Logging, PrintStreamLogging, TransactionId} import org.apache.openwhisk.core.connector.ActivationMessage @@ -54,7 +54,7 @@ import org.scalatest.concurrent.Eventually class ContainerPoolTests extends TestKit(ActorSystem("ContainerPool")) with ImplicitSender - with FlatSpecLike + with AnyFlatSpecLike with Matchers with BeforeAndAfterAll with MockFactory @@ -993,7 +993,7 @@ abstract class MockableContainer extends Container { * of the ContainerPool object. */ @RunWith(classOf[JUnitRunner]) -class ContainerPoolObjectTests extends FlatSpec with Matchers with MockFactory { +class ContainerPoolObjectTests extends AnyFlatSpec with Matchers with MockFactory { val actionExec = CodeExecAsString(RuntimeManifest("actionKind", ImageName("testImage")), "testCode", None) val standardNamespace = EntityName("standardNamespace") diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerProxyTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerProxyTests.scala index f8f856e411e..cedb912f2a8 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerProxyTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerProxyTests.scala @@ -20,19 +20,21 @@ package org.apache.openwhisk.core.containerpool.test import java.net.InetSocketAddress import java.time.Instant -import akka.actor.FSM.{CurrentState, SubscribeTransitionCallBack, Transition} -import akka.actor.{ActorRef, ActorSystem, FSM} -import akka.stream.scaladsl.Source -import akka.testkit.{CallingThreadDispatcher, ImplicitSender, TestKit, TestProbe} -import akka.util.ByteString +import org.apache.pekko.actor.FSM.{CurrentState, SubscribeTransitionCallBack, Transition} +import org.apache.pekko.actor.{ActorRef, ActorSystem, FSM} +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.testkit.{CallingThreadDispatcher, ImplicitSender, TestKit, TestProbe} +import org.apache.pekko.util.ByteString import common.{LoggedFunction, StreamLogging, SynchronizedLoggedFunction, WhiskProperties} import java.time.temporal.ChronoUnit import java.util.concurrent.atomic.AtomicInteger -import akka.io.Tcp.{Close, CommandFailed, Connect, Connected} +import org.apache.pekko.io.Tcp.{Close, CommandFailed, Connect, Connected} import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, FlatSpecLike, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import spray.json.DefaultJsonProtocol._ import spray.json._ import org.apache.openwhisk.common.{Logging, TransactionId} @@ -64,7 +66,7 @@ import scala.concurrent.{ExecutionContext, Future, Promise} class ContainerProxyTests extends TestKit(ActorSystem("ContainerProxys")) with ImplicitSender - with FlatSpecLike + with AnyFlatSpecLike with Matchers with BeforeAndAfterAll with StreamLogging { @@ -2219,7 +2221,7 @@ class ContainerProxyTests } } @RunWith(classOf[JUnitRunner]) -class TCPPingClientTests extends TestKit(ActorSystem("TCPPingClient")) with Matchers with FlatSpecLike { +class TCPPingClientTests extends TestKit(ActorSystem("TCPPingClient")) with Matchers with AnyFlatSpecLike { val config = ContainerProxyHealthCheckConfig(true, 200.milliseconds, 2) val addr = new InetSocketAddress("1.2.3.4", 12345) val localAddr = new InetSocketAddress("localhost", 5432) diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/v2/test/ActivationClientProxyTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/v2/test/ActivationClientProxyTests.scala index 3b29ba2ab34..e78ee6db012 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/v2/test/ActivationClientProxyTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/v2/test/ActivationClientProxyTests.scala @@ -17,12 +17,12 @@ package org.apache.openwhisk.core.containerpool.v2.test -import akka.Done -import akka.actor.FSM.{CurrentState, SubscribeTransitionCallBack, Transition} -import akka.actor.Status.Failure -import akka.actor.{ActorRef, ActorSystem} -import akka.grpc.internal.ClientClosedException -import akka.testkit.{ImplicitSender, TestKit, TestProbe} +import org.apache.pekko.Done +import org.apache.pekko.actor.FSM.{CurrentState, SubscribeTransitionCallBack, Transition} +import org.apache.pekko.actor.Status.Failure +import org.apache.pekko.actor.{ActorRef, ActorSystem} +import org.apache.pekko.grpc.internal.ClientClosedException +import org.apache.pekko.testkit.{ImplicitSender, TestKit, TestProbe} import common.StreamLogging import io.grpc.StatusRuntimeException import org.apache.openwhisk.common.{GracefulShutdown, TransactionId} @@ -39,8 +39,10 @@ import org.apache.openwhisk.grpc.{ActivationServiceClient, FetchRequest, Resched import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, FlatSpecLike, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import scala.collection.mutable.ArrayBuffer import scala.concurrent.Future @@ -50,7 +52,7 @@ import scala.concurrent.duration._ class ActivationClientProxyTests extends TestKit(ActorSystem("ActivationClientProxy")) with ImplicitSender - with FlatSpecLike + with AnyFlatSpecLike with Matchers with MockFactory with BeforeAndAfterAll @@ -293,7 +295,7 @@ class ActivationClientProxyTests probe.expectMsg(RetryRequestActivation) } - it should "be recreated when akka grpc server connection failed" in within(timeout) { + it should "be recreated when pekko grpc server connection failed" in within(timeout) { var creationCount = 0 val fetch = (_: FetchRequest) => Future { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/v2/test/FunctionPullingContainerPoolTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/v2/test/FunctionPullingContainerPoolTests.scala index 714a8f9b1e5..78bf03a8a52 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/v2/test/FunctionPullingContainerPoolTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/v2/test/FunctionPullingContainerPoolTests.scala @@ -19,8 +19,8 @@ package org.apache.openwhisk.core.containerpool.v2.test import java.time.Instant import java.util.concurrent.TimeUnit -import akka.actor.{ActorRef, ActorRefFactory, ActorSystem, Props} -import akka.testkit.{ImplicitSender, TestActor, TestActorRef, TestKit, TestProbe} +import org.apache.pekko.actor.{ActorRef, ActorRefFactory, ActorSystem, Props} +import org.apache.pekko.testkit.{ImplicitSender, TestActor, TestActorRef, TestKit, TestProbe} import common.StreamLogging import org.apache.openwhisk.common.{Enable, GracefulShutdown, TransactionId} import org.apache.openwhisk.core.WhiskConfig @@ -50,8 +50,10 @@ import org.apache.openwhisk.core.entity.size._ import org.apache.openwhisk.utils.{retry => utilRetry} import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FlatSpecLike, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import org.scalatest.concurrent.Eventually import scala.collection.mutable @@ -69,7 +71,7 @@ import scala.language.postfixOps class FunctionPullingContainerPoolTests extends TestKit(ActorSystem("FunctionPullingContainerPool")) with ImplicitSender - with FlatSpecLike + with AnyFlatSpecLike with Matchers with BeforeAndAfterAll with BeforeAndAfterEach diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/v2/test/FunctionPullingContainerProxyTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/v2/test/FunctionPullingContainerProxyTests.scala index b80f7307f7c..23a65b9e1e6 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/v2/test/FunctionPullingContainerProxyTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/v2/test/FunctionPullingContainerProxyTests.scala @@ -17,13 +17,13 @@ package org.apache.openwhisk.core.containerpool.v2.test -import akka.actor.FSM.{CurrentState, StateTimeout, SubscribeTransitionCallBack, Transition} -import akka.actor.{Actor, ActorRef, ActorRefFactory, ActorSystem, Props} -import akka.http.scaladsl.model -import akka.io.Tcp.Connect -import akka.stream.scaladsl.{Sink, Source} -import akka.testkit.{ImplicitSender, TestFSMRef, TestKit, TestProbe} -import akka.util.ByteString +import org.apache.pekko.actor.FSM.{CurrentState, StateTimeout, SubscribeTransitionCallBack, Transition} +import org.apache.pekko.actor.{Actor, ActorRef, ActorRefFactory, ActorSystem, Props} +import org.apache.pekko.http.scaladsl.model +import org.apache.pekko.io.Tcp.Connect +import org.apache.pekko.stream.scaladsl.{Sink, Source} +import org.apache.pekko.testkit.{ImplicitSender, TestFSMRef, TestKit, TestProbe} +import org.apache.pekko.util.ByteString import com.ibm.etcd.api.{DeleteRangeResponse, KeyValue, PutResponse} import com.ibm.etcd.client.{EtcdClient => Client} import common.{LoggedFunction, StreamLogging, SynchronizedLoggedFunction} @@ -55,8 +55,10 @@ import org.apache.openwhisk.core.service.{GetLease, Lease, RegisterData, Unregis import org.apache.openwhisk.http.Messages import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory -import org.scalatest.junit.JUnitRunner -import org.scalatest.{Assertion, BeforeAndAfterAll, FlatSpecLike, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.{Assertion, BeforeAndAfterAll} +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import spray.json.DefaultJsonProtocol._ import spray.json.{JsObject, _} @@ -72,7 +74,7 @@ import scala.concurrent.{ExecutionContext, ExecutionContextExecutor, Future, Pro class FunctionPullingContainerProxyTests extends TestKit(ActorSystem("FunctionPullingContainerProxy")) with ImplicitSender - with FlatSpecLike + with AnyFlatSpecLike with Matchers with MockFactory with BeforeAndAfterAll diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/v2/test/InvokerHealthManagerTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/v2/test/InvokerHealthManagerTests.scala index 7d12becbbef..69f6006119c 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/v2/test/InvokerHealthManagerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/v2/test/InvokerHealthManagerTests.scala @@ -17,9 +17,9 @@ package org.apache.openwhisk.core.containerpool.v2.test -import akka.actor.FSM.{CurrentState, SubscribeTransitionCallBack, Transition} -import akka.actor.{ActorRef, ActorRefFactory, ActorSystem} -import akka.testkit.{ImplicitSender, TestActor, TestFSMRef, TestKit, TestProbe} +import org.apache.pekko.actor.FSM.{CurrentState, SubscribeTransitionCallBack, Transition} +import org.apache.pekko.actor.{ActorRef, ActorRefFactory, ActorSystem} +import org.apache.pekko.testkit.{ImplicitSender, TestActor, TestFSMRef, TestKit, TestProbe} import common.StreamLogging import org.apache.openwhisk.common.InvokerState.{Healthy, Offline, Unhealthy} import org.apache.openwhisk.common.{Enable, GracefulShutdown, RingBuffer} @@ -34,8 +34,10 @@ import org.apache.openwhisk.core.service.UpdateDataOnChange import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FlatSpecLike, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import scala.collection.mutable import scala.concurrent.duration._ @@ -43,7 +45,7 @@ import scala.concurrent.duration._ class InvokerHealthManagerTests extends TestKit(ActorSystem("InvokerHealthManager")) with ImplicitSender - with FlatSpecLike + with AnyFlatSpecLike with Matchers with BeforeAndAfterAll with BeforeAndAfterEach @@ -330,11 +332,6 @@ class InvokerHealthManagerTests instanceId.dedicatedNamespaces).serialize)) val mockHealthActionProxy = TestProbe() - fsm.underlyingActor.healthActionProxy = Some(mockHealthActionProxy.ref) - - fsm ! Enable - - probe.expectMsg(Transition(fsm, Offline, Unhealthy)) mockHealthActionProxy.setAutoPilot((sender, msg) => msg match { @@ -342,13 +339,17 @@ class InvokerHealthManagerTests (1 to InvokerHealthManager.bufferSize - InvokerHealthManager.bufferErrorTolerance) foreach { _ => sender ! HealthMessage(true) } - TestActor.KeepRunning case GracefulShutdown => TestActor.KeepRunning - }) + + fsm.underlyingActor.healthActionProxy = Some(mockHealthActionProxy.ref) + + fsm ! Enable + + probe.expectMsg(Transition(fsm, Offline, Unhealthy)) probe.expectMsg(10.seconds, Transition(fsm, Unhealthy, Healthy)) dataManagementService.expectMsg( diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/yarn/test/MockYARNRM.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/yarn/test/MockYARNRM.scala index 2b71c3f065b..06c6f1e08bf 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/yarn/test/MockYARNRM.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/yarn/test/MockYARNRM.scala @@ -22,7 +22,7 @@ import java.nio.charset.StandardCharsets import java.util import java.util.concurrent.atomic.AtomicLong -import akka.http.scaladsl.model.DateTime +import org.apache.pekko.http.scaladsl.model.DateTime import com.sun.net.httpserver.{HttpExchange, HttpServer} import org.apache.openwhisk.core.yarn.YARNJsonProtocol._ import org.apache.openwhisk.core.yarn.{YARNResponseDefinition, _} diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/yarn/test/YARNContainerFactoryTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/yarn/test/YARNContainerFactoryTests.scala index 56196ed4c7b..6d96d21bcda 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/yarn/test/YARNContainerFactoryTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/yarn/test/YARNContainerFactoryTests.scala @@ -17,8 +17,8 @@ package org.apache.openwhisk.core.containerpool.yarn.test -import akka.actor.ActorSystem -import akka.http.scaladsl.model.DateTime +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model.DateTime import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.WhiskConfig import org.apache.openwhisk.core.WhiskConfig._ @@ -27,8 +27,9 @@ import org.apache.openwhisk.core.entity.ExecManifest.ImageName import org.apache.openwhisk.core.entity.{ByteSize, ExecManifest, InvokerInstanceId, SizeUnits} import org.apache.openwhisk.core.yarn.{YARNConfig, YARNContainerFactory, YARNRESTUtil, YARNTask} import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfter, BeforeAndAfterAll, FlatSpecLike, Suite} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.{BeforeAndAfter, BeforeAndAfterAll, Suite} +import org.scalatest.flatspec.AnyFlatSpecLike import org.apache.openwhisk.core.entity.test.ExecHelpers import scala.collection.immutable.Map @@ -39,7 +40,7 @@ import scala.concurrent.duration._ class YARNContainerFactoryTests extends Suite with BeforeAndAfter - with FlatSpecLike + with AnyFlatSpecLike with ExecHelpers with BeforeAndAfterAll { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/actions/test/SequenceAccountingTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/actions/test/SequenceAccountingTests.scala index b49fe09461d..816069572c9 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/actions/test/SequenceAccountingTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/actions/test/SequenceAccountingTests.scala @@ -22,9 +22,9 @@ import java.time.Instant import scala.concurrent.duration.DurationInt import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import common.WskActorSystem import spray.json._ @@ -35,7 +35,7 @@ import org.apache.openwhisk.core.entity.size.SizeInt import org.apache.openwhisk.http.Messages @RunWith(classOf[JUnitRunner]) -class SequenceAccountingTests extends FlatSpec with Matchers with WskActorSystem { +class SequenceAccountingTests extends AnyFlatSpec with Matchers with WskActorSystem { behavior of "sequence accounting" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiTests.scala index 82ffe82b3cb..c08809c7843 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiTests.scala @@ -21,11 +21,11 @@ import java.time.Instant import scala.concurrent.duration.DurationInt import scala.language.postfixOps import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonMarshaller -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonUnmarshaller -import akka.http.scaladsl.server.Route +import org.scalatestplus.junit.JUnitRunner +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonMarshaller +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonUnmarshaller +import org.apache.pekko.http.scaladsl.server.Route import spray.json._ import spray.json.DefaultJsonProtocol._ import org.apache.openwhisk.core.controller.WhiskActionsApi @@ -35,12 +35,13 @@ import org.apache.openwhisk.core.entitlement.Collection import org.apache.openwhisk.http.ErrorResponse import org.apache.openwhisk.http.Messages import org.apache.openwhisk.core.database.UserContext -import akka.http.scaladsl.model.headers.RawHeader +import org.apache.pekko.http.scaladsl.model.headers.RawHeader import org.apache.commons.lang3.StringUtils import org.apache.openwhisk.core.connector.ActivationMessage import org.apache.openwhisk.core.entity.Attachments.Inline import org.apache.openwhisk.core.entity.test.ExecHelpers -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers /** * Tests Actions API. @@ -2133,7 +2134,7 @@ class ActionsApiTests extends ControllerTestCommon with WhiskActionsApi { } @RunWith(classOf[JUnitRunner]) -class WhiskActionsApiTests extends FlatSpec with Matchers with ExecHelpers { +class WhiskActionsApiTests extends AnyFlatSpec with Matchers with ExecHelpers { import WhiskActionsApi.amendAnnotations import Annotations.ProvideApiKeyAnnotationName import WhiskAction.execFieldName diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiWithDbPollingTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiWithDbPollingTests.scala index cc391a18631..fc891570637 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiWithDbPollingTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiWithDbPollingTests.scala @@ -18,16 +18,16 @@ package org.apache.openwhisk.core.controller.test import java.time.Instant -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonUnmarshaller -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.model.headers.RawHeader -import akka.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonUnmarshaller +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.model.headers.RawHeader +import org.apache.pekko.http.scaladsl.server.Route import org.apache.openwhisk.core.controller.WhiskActionsApi import org.apache.openwhisk.core.controller.actions.ControllerActivationConfig import org.apache.openwhisk.core.database.{ActivationStoreLevel, UserContext} import org.apache.openwhisk.core.entity._ import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import spray.json.DefaultJsonProtocol._ import spray.json._ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiWithoutDbPollingTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiWithoutDbPollingTests.scala index a5e9400aede..328225bcc3a 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiWithoutDbPollingTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiWithoutDbPollingTests.scala @@ -19,16 +19,16 @@ package org.apache.openwhisk.core.controller.test import java.time.Instant -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonUnmarshaller -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.model.headers.RawHeader -import akka.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonUnmarshaller +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.model.headers.RawHeader +import org.apache.pekko.http.scaladsl.server.Route import org.apache.openwhisk.core.controller.WhiskActionsApi import org.apache.openwhisk.core.controller.actions.ControllerActivationConfig import org.apache.openwhisk.core.database.UserContext import org.apache.openwhisk.core.entity._ import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import spray.json.DefaultJsonProtocol._ import spray.json._ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActivationsApiTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActivationsApiTests.scala index 5e266ddb4c2..fb7190a1396 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActivationsApiTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActivationsApiTests.scala @@ -18,11 +18,11 @@ package org.apache.openwhisk.core.controller.test import java.time.{Clock, Instant} -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.server.Route import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import spray.json.DefaultJsonProtocol._ import spray.json._ import org.apache.openwhisk.core.controller.WhiskActivationsApi diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/BasicAuthenticateTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/BasicAuthenticateTests.scala index fd4fcbcf751..bad35a05fa1 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/BasicAuthenticateTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/BasicAuthenticateTests.scala @@ -20,9 +20,9 @@ package org.apache.openwhisk.core.controller.test import scala.concurrent.Await import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner -import akka.http.scaladsl.model.headers.BasicHttpCredentials +import org.apache.pekko.http.scaladsl.model.headers.BasicHttpCredentials import org.apache.openwhisk.core.controller.BasicAuthenticationDirective import org.apache.openwhisk.core.entity._ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ConductorsApiTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ConductorsApiTests.scala index 7c87e11217b..90e23ea8906 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ConductorsApiTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ConductorsApiTests.scala @@ -23,11 +23,11 @@ import scala.concurrent.Future import scala.concurrent.ExecutionContext import scala.language.postfixOps import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonMarshaller -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonUnmarshaller -import akka.http.scaladsl.server.Route +import org.scalatestplus.junit.JUnitRunner +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonMarshaller +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonUnmarshaller +import org.apache.pekko.http.scaladsl.server.Route import spray.json._ import spray.json.DefaultJsonProtocol._ import org.apache.openwhisk.common.TransactionId diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ControllerApiTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ControllerApiTests.scala index 5917c039619..48da2efefcf 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ControllerApiTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ControllerApiTests.scala @@ -22,8 +22,9 @@ import io.restassured.RestAssured import org.apache.openwhisk.core.WhiskConfig import org.apache.openwhisk.core.entity.{ExecManifest, LogLimit, MemoryLimit, TimeLimit} import org.junit.runner.RunWith -import org.scalatest.{FlatSpec, Matchers} -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import spray.json.DefaultJsonProtocol._ import spray.json._ import system.rest.RestUtil @@ -32,7 +33,7 @@ import system.rest.RestUtil * Integration tests for Controller routes */ @RunWith(classOf[JUnitRunner]) -class ControllerApiTests extends FlatSpec with RestUtil with Matchers with StreamLogging { +class ControllerApiTests extends AnyFlatSpec with RestUtil with Matchers with StreamLogging { it should "ensure controller returns info" in { val response = RestAssured.given.config(sslconfig).get(getServiceURL) diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ControllerRoutesTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ControllerRoutesTests.scala index 88ad6d9d642..60037e48029 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ControllerRoutesTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ControllerRoutesTests.scala @@ -17,17 +17,17 @@ package org.apache.openwhisk.core.controller.test -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.server.Route -import org.apache.openwhisk.common.AkkaLogging +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.openwhisk.common.PekkoLogging import org.apache.openwhisk.core.controller.Controller import org.apache.openwhisk.core.entity.ExecManifest.Runtimes import org.junit.runner.RunWith import org.scalatest.BeforeAndAfterEach -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import system.rest.RestUtil import spray.json._ -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ import spray.json.DefaultJsonProtocol._ /** @@ -39,7 +39,7 @@ import spray.json.DefaultJsonProtocol._ @RunWith(classOf[JUnitRunner]) class ControllerRoutesTests extends ControllerTestCommon with BeforeAndAfterEach with RestUtil { - implicit val logger = new AkkaLogging(akka.event.Logging.getLogger(actorSystem, this)) + implicit val logger = new PekkoLogging(org.apache.pekko.event.Logging.getLogger(actorSystem, this)) behavior of "Controller" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ControllerTestCommon.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ControllerTestCommon.scala index a9a72f460c4..37db3a738e9 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ControllerTestCommon.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ControllerTestCommon.scala @@ -23,11 +23,11 @@ import scala.concurrent.duration.{Duration, DurationInt, FiniteDuration} import scala.language.postfixOps import org.scalatest.BeforeAndAfterEach import org.scalatest.BeforeAndAfterAll -import org.scalatest.FlatSpec -import org.scalatest.Matchers +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import common.StreamLogging -import akka.http.scaladsl.testkit.ScalatestRouteTest -import akka.http.scaladsl.testkit.RouteTestTimeout +import org.apache.pekko.http.scaladsl.testkit.ScalatestRouteTest +import org.apache.pekko.http.scaladsl.testkit.RouteTestTimeout import spray.json._ import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.{FeatureFlags, WhiskConfig} @@ -49,7 +49,7 @@ import org.apache.openwhisk.core.loadBalancer.LoadBalancer import org.apache.openwhisk.spi.SpiLoader protected trait ControllerTestCommon - extends FlatSpec + extends AnyFlatSpec with BeforeAndAfterEach with BeforeAndAfterAll with ScalatestRouteTest diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/EntitlementProviderTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/EntitlementProviderTests.scala index 48edcd45c96..bcbdce2ac5d 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/EntitlementProviderTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/EntitlementProviderTests.scala @@ -22,8 +22,8 @@ import scala.concurrent.Await import scala.concurrent.duration.DurationInt import org.junit.runner.RunWith import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import akka.http.scaladsl.model.StatusCodes._ +import org.scalatestplus.junit.JUnitRunner +import org.apache.pekko.http.scaladsl.model.StatusCodes._ import org.apache.openwhisk.core.controller.RejectRequest import org.apache.openwhisk.core.entitlement._ import org.apache.openwhisk.core.entitlement.Privilege._ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/FPCEntitlementTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/FPCEntitlementTests.scala index a62ac24a039..f1592f658e9 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/FPCEntitlementTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/FPCEntitlementTests.scala @@ -26,7 +26,7 @@ import org.apache.openwhisk.core.loadBalancer.LoadBalancer import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) class FPCEntitlementProviderTests extends ControllerTestCommon with ScalaFutures with MockFactory { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/KindRestrictorTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/KindRestrictorTests.scala index 4f29d370125..03a7ad3fff6 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/KindRestrictorTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/KindRestrictorTests.scala @@ -19,8 +19,9 @@ package org.apache.openwhisk.core.controller.test import common.StreamLogging import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import org.apache.openwhisk.core.entitlement.KindRestrictor import org.apache.openwhisk.core.entity._ @@ -35,7 +36,7 @@ import org.apache.openwhisk.core.entity._ * "using Specification DSL to write unit tests, as in should, must, not, be" */ @RunWith(classOf[JUnitRunner]) -class KindRestrictorTests extends FlatSpec with Matchers with StreamLogging { +class KindRestrictorTests extends AnyFlatSpec with Matchers with StreamLogging { behavior of "Kind Restrictor" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/LimitsApiTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/LimitsApiTests.scala index 1b2f46e2de8..af1c4a27ead 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/LimitsApiTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/LimitsApiTests.scala @@ -18,10 +18,10 @@ package org.apache.openwhisk.core.controller.test import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import akka.http.scaladsl.model.StatusCodes.{BadRequest, MethodNotAllowed, OK} -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonUnmarshaller -import akka.http.scaladsl.server.Route +import org.scalatestplus.junit.JUnitRunner +import org.apache.pekko.http.scaladsl.model.StatusCodes.{BadRequest, MethodNotAllowed, OK} +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonUnmarshaller +import org.apache.pekko.http.scaladsl.server.Route import org.apache.openwhisk.core.controller.WhiskLimitsApi import org.apache.openwhisk.core.entity.{ EntityPath, diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/NamespacesApiTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/NamespacesApiTests.scala index 99b17920c21..2a8a8d07724 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/NamespacesApiTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/NamespacesApiTests.scala @@ -18,12 +18,12 @@ package org.apache.openwhisk.core.controller.test import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner -import akka.http.scaladsl.model.StatusCodes.OK -import akka.http.scaladsl.model.StatusCodes.NotFound -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonUnmarshaller -import akka.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.model.StatusCodes.OK +import org.apache.pekko.http.scaladsl.model.StatusCodes.NotFound +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonUnmarshaller +import org.apache.pekko.http.scaladsl.server.Route import spray.json.DefaultJsonProtocol._ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/PackageActionsApiTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/PackageActionsApiTests.scala index 639aa02c97c..b03a60e75e0 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/PackageActionsApiTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/PackageActionsApiTests.scala @@ -19,11 +19,11 @@ package org.apache.openwhisk.core.controller.test import scala.concurrent.duration.DurationInt import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.server.Route import spray.json.DefaultJsonProtocol._ import spray.json._ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/PackagesApiTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/PackagesApiTests.scala index 578e7ff2651..8c31eced89e 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/PackagesApiTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/PackagesApiTests.scala @@ -17,11 +17,11 @@ package org.apache.openwhisk.core.controller.test -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.server.Route import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import spray.json.DefaultJsonProtocol._ import spray.json._ import org.apache.openwhisk.core.controller.WhiskPackagesApi diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/RateThrottleTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/RateThrottleTests.scala index 088f0120e5d..6fcd1445bfc 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/RateThrottleTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/RateThrottleTests.scala @@ -20,9 +20,9 @@ package org.apache.openwhisk.core.controller.test import scala.concurrent.duration.DurationInt import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import common.StreamLogging import org.apache.openwhisk.common.TransactionId @@ -36,7 +36,7 @@ import org.apache.openwhisk.core.entity.UserLimits * "using Specification DSL to write unit tests, as in should, must, not, be" */ @RunWith(classOf[JUnitRunner]) -class RateThrottleTests extends FlatSpec with Matchers with StreamLogging { +class RateThrottleTests extends AnyFlatSpec with Matchers with StreamLogging { implicit val transid = TransactionId.testing val subject = WhiskAuthHelpers.newIdentity() diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/RespondWithHeadersTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/RespondWithHeadersTests.scala index 50ad7cdfa55..8c621b3ed2b 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/RespondWithHeadersTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/RespondWithHeadersTests.scala @@ -18,11 +18,11 @@ package org.apache.openwhisk.core.controller.test import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner -import akka.http.scaladsl.model.StatusCodes.NotFound -import akka.http.scaladsl.model.StatusCodes.OK -import akka.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.model.StatusCodes.NotFound +import org.apache.pekko.http.scaladsl.model.StatusCodes.OK +import org.apache.pekko.http.scaladsl.server.Route import org.apache.openwhisk.core.controller.RespondWithHeaders diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/RulesApiTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/RulesApiTests.scala index 1505305b560..841e32aaf99 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/RulesApiTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/RulesApiTests.scala @@ -21,10 +21,10 @@ import java.time.Instant import scala.language.postfixOps import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.server.Route +import org.scalatestplus.junit.JUnitRunner +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.server.Route import spray.json.DefaultJsonProtocol._ import spray.json._ import org.apache.openwhisk.core.controller.WhiskRulesApi diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/SequenceApiTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/SequenceApiTests.scala index 896c14a73c2..f1835100814 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/SequenceApiTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/SequenceApiTests.scala @@ -19,15 +19,15 @@ package org.apache.openwhisk.core.controller.test import java.time.Instant -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.server.Route import org.apache.openwhisk.core.controller.WhiskActionsApi import org.apache.openwhisk.core.entity._ import org.apache.openwhisk.http.Messages.sequenceComponentNotFound import org.apache.openwhisk.http.{ErrorResponse, Messages} import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import spray.json.DefaultJsonProtocol._ import spray.json._ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/SwaggerRoutesTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/SwaggerRoutesTests.scala index aaeab3cb06a..8fcd4216e97 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/SwaggerRoutesTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/SwaggerRoutesTests.scala @@ -19,12 +19,12 @@ package org.apache.openwhisk.core.controller.test import org.junit.runner.RunWith import org.scalatest.BeforeAndAfterEach -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.server.Route -import akka.http.scaladsl.model.Uri +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.model.Uri import spray.json._ import spray.json.DefaultJsonProtocol._ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/TriggersApiTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/TriggersApiTests.scala index ae7b4fc0a94..4c866ffbd32 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/TriggersApiTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/TriggersApiTests.scala @@ -23,12 +23,12 @@ import scala.concurrent.duration.DurationInt import scala.language.postfixOps import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.server.Route -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.model.headers.RawHeader +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.model.headers.RawHeader import spray.json._ import spray.json.DefaultJsonProtocol._ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/WebActionsApiTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/WebActionsApiTests.scala index e2e8c391bf0..c16eb13afb5 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/WebActionsApiTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/WebActionsApiTests.scala @@ -23,24 +23,26 @@ import java.util.Base64 import scala.concurrent.Future import scala.concurrent.duration.FiniteDuration import org.junit.runner.RunWith -import org.scalatest.{BeforeAndAfterEach, FlatSpec, Matchers} -import org.scalatest.junit.JUnitRunner -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.model.FormData -import akka.http.scaladsl.model.HttpEntity -import akka.http.scaladsl.model.MediaTypes -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.model.HttpCharsets -import akka.http.scaladsl.model.HttpHeader -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.Uri.Query -import akka.http.scaladsl.server.Route -import akka.http.scaladsl.model.HttpMethods -import akka.http.scaladsl.model.headers.{`Access-Control-Request-Headers`, `Content-Type`, RawHeader} -import akka.http.scaladsl.model.ContentTypes -import akka.http.scaladsl.model.ContentType -import akka.http.scaladsl.model.MediaType +import org.scalatest.BeforeAndAfterEach +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.model.FormData +import org.apache.pekko.http.scaladsl.model.HttpEntity +import org.apache.pekko.http.scaladsl.model.MediaTypes +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.model.HttpCharsets +import org.apache.pekko.http.scaladsl.model.HttpHeader +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.Uri.Query +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.model.HttpMethods +import org.apache.pekko.http.scaladsl.model.headers.{`Access-Control-Request-Headers`, `Content-Type`, RawHeader} +import org.apache.pekko.http.scaladsl.model.ContentTypes +import org.apache.pekko.http.scaladsl.model.ContentType +import org.apache.pekko.http.scaladsl.model.MediaType import spray.json._ import spray.json.DefaultJsonProtocol._ import org.apache.openwhisk.common.TransactionId @@ -70,7 +72,7 @@ import scala.collection.immutable.Set */ @RunWith(classOf[JUnitRunner]) -class WebActionsApiCommonTests extends FlatSpec with Matchers { +class WebActionsApiCommonTests extends AnyFlatSpec with Matchers { "extension splitter" should "split action name and extension" in { Seq(".http", ".json", ".text", ".html", ".svg").foreach { ext => Seq(s"t$ext", s"tt$ext", s"t.wxyz$ext", s"tt.wxyz$ext").foreach { s => @@ -98,7 +100,7 @@ class WebActionsApiCommonTests extends FlatSpec with Matchers { } @RunWith(classOf[JUnitRunner]) -class WebActionsApiTests extends FlatSpec with Matchers with WebActionsApiBaseTests { +class WebActionsApiTests extends AnyFlatSpec with Matchers with WebActionsApiBaseTests { override lazy val webInvokePathSegments = Seq("web") override lazy val webApiDirectives = new WebApiDirectives() diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/migration/SequenceActionApiMigrationTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/migration/SequenceActionApiMigrationTests.scala index eb3e73eb5c5..71f322d25ad 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/migration/SequenceActionApiMigrationTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/migration/SequenceActionApiMigrationTests.scala @@ -20,14 +20,14 @@ package org.apache.openwhisk.core.controller.test.migration import scala.Vector import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common.TestHelpers import common.WskTestHelpers -import akka.http.scaladsl.server.Route -import akka.http.scaladsl.model.StatusCodes.OK -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.model.StatusCodes.OK +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ import spray.json.DefaultJsonProtocol._ import spray.json._ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/ArtifactActivationStoreBehaviorBase.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/ArtifactActivationStoreBehaviorBase.scala index c11f1f1bc10..848bb7c6ba8 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/ArtifactActivationStoreBehaviorBase.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/ArtifactActivationStoreBehaviorBase.scala @@ -19,9 +19,9 @@ package org.apache.openwhisk.core.database import org.apache.openwhisk.core.controller.test.WhiskAuthHelpers import org.apache.openwhisk.core.database.test.behavior.ActivationStoreBehaviorBase -import org.scalatest.FlatSpec +import org.scalatest.flatspec.AnyFlatSpec -trait ArtifactActivationStoreBehaviorBase extends FlatSpec with ActivationStoreBehaviorBase { +trait ArtifactActivationStoreBehaviorBase extends AnyFlatSpec with ActivationStoreBehaviorBase { override def storeType = "Artifact" override val context = UserContext(WhiskAuthHelpers.newIdentity()) diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/ArtifactActivationStoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/ArtifactActivationStoreTests.scala index 86cb5ad7dc0..17b6beb4c02 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/ArtifactActivationStoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/ArtifactActivationStoreTests.scala @@ -24,12 +24,12 @@ import org.apache.openwhisk.core.database.test.behavior.ActivationStoreBehavior import org.apache.openwhisk.core.entity.{EntityPath, WhiskActivation} import org.apache.openwhisk.utils.retry import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) class ArtifactActivationStoreTests - extends FlatSpec + extends AnyFlatSpec with ArtifactActivationStoreBehaviorBase with ActivationStoreBehavior { override def checkQueryActivations(namespace: String, diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/ArtifactWithFileStorageActivationStoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/ArtifactWithFileStorageActivationStoreTests.scala index 56048d7d915..f9e2efcb3b9 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/ArtifactWithFileStorageActivationStoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/ArtifactWithFileStorageActivationStoreTests.scala @@ -21,14 +21,16 @@ import java.io.File import java.nio.file.Paths import java.time.Instant -import akka.actor.ActorSystem -import akka.http.scaladsl.model.HttpRequest -import akka.testkit.TestKit +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.testkit.TestKit import common.StreamLogging import org.junit.runner.RunWith import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, FlatSpecLike, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import spray.json.DefaultJsonProtocol._ import spray.json._ import org.apache.openwhisk.common.{Logging, TransactionId, WhiskInstants} @@ -45,7 +47,7 @@ import scala.io.Source @RunWith(classOf[JUnitRunner]) class ArtifactWithFileStorageActivationStoreTests() extends TestKit(ActorSystem("ArtifactWithFileStorageActivationStoreTests")) - with FlatSpecLike + with AnyFlatSpecLike with Matchers with BeforeAndAfterAll with ScalaFutures diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/CouchDBArtifactStoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/CouchDBArtifactStoreTests.scala index 4d150573232..84a2def61fa 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/CouchDBArtifactStoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/CouchDBArtifactStoreTests.scala @@ -18,9 +18,9 @@ package org.apache.openwhisk.core.database import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner import org.apache.openwhisk.core.database.test.behavior.ArtifactStoreBehavior @RunWith(classOf[JUnitRunner]) -class CouchDBArtifactStoreTests extends FlatSpec with CouchDBStoreBehaviorBase with ArtifactStoreBehavior {} +class CouchDBArtifactStoreTests extends AnyFlatSpec with CouchDBStoreBehaviorBase with ArtifactStoreBehavior {} diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/CouchDBAttachmentStoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/CouchDBAttachmentStoreTests.scala index def5673fbbd..b4a7fc62666 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/CouchDBAttachmentStoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/CouchDBAttachmentStoreTests.scala @@ -18,15 +18,18 @@ package org.apache.openwhisk.core.database import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner import org.apache.openwhisk.core.database.memory.MemoryAttachmentStoreProvider import org.apache.openwhisk.core.database.test.behavior.ArtifactStoreAttachmentBehaviors import scala.reflect.ClassTag @RunWith(classOf[JUnitRunner]) -class CouchDBAttachmentStoreTests extends FlatSpec with CouchDBStoreBehaviorBase with ArtifactStoreAttachmentBehaviors { +class CouchDBAttachmentStoreTests + extends AnyFlatSpec + with CouchDBStoreBehaviorBase + with ArtifactStoreAttachmentBehaviors { override protected def getAttachmentStore[D <: DocumentSerializer: ClassTag]() = Some(MemoryAttachmentStoreProvider.makeStore[D]()) } diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/CouchDBStoreBehaviorBase.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/CouchDBStoreBehaviorBase.scala index 27307790150..a31442d2b1d 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/CouchDBStoreBehaviorBase.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/CouchDBStoreBehaviorBase.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.database -import org.scalatest.FlatSpec +import org.scalatest.flatspec.AnyFlatSpec import org.apache.openwhisk.core.database.test.behavior.ArtifactStoreBehaviorBase import org.apache.openwhisk.core.entity.{ DocumentReader, @@ -30,7 +30,7 @@ import org.apache.openwhisk.core.entity.{ import scala.reflect.{classTag, ClassTag} -trait CouchDBStoreBehaviorBase extends FlatSpec with ArtifactStoreBehaviorBase { +trait CouchDBStoreBehaviorBase extends AnyFlatSpec with ArtifactStoreBehaviorBase { override def storeType = "CouchDB" override val authStore = { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/LimitsCommandTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/LimitsCommandTests.scala index e30cd409a04..9b226d35dd5 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/LimitsCommandTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/LimitsCommandTests.scala @@ -18,8 +18,8 @@ package org.apache.openwhisk.core.database import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.cli.CommandMessages import org.apache.openwhisk.core.database.LimitsCommand.LimitEntity @@ -30,7 +30,7 @@ import scala.concurrent.duration.Duration import scala.util.Try @RunWith(classOf[JUnitRunner]) -class LimitsCommandTests extends FlatSpec with WhiskAdminCliTestBase { +class LimitsCommandTests extends AnyFlatSpec with WhiskAdminCliTestBase { private val limitsToDelete = ListBuffer[String]() protected val limitsStore = LimitsCommand.createDataStore() diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/UserCommandTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/UserCommandTests.scala index 62dc0606f5b..9d586368a96 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/UserCommandTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/UserCommandTests.scala @@ -18,8 +18,8 @@ package org.apache.openwhisk.core.database import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.cli.{CommandMessages, Conf, WhiskAdmin} import org.apache.openwhisk.core.entity._ @@ -30,7 +30,7 @@ import scala.util.Try import org.apache.openwhisk.core.database.UserCommand.ExtendedAuth @RunWith(classOf[JUnitRunner]) -class UserCommandTests extends FlatSpec with WhiskAdminCliTestBase { +class UserCommandTests extends AnyFlatSpec with WhiskAdminCliTestBase { private val usersToDelete = ListBuffer[String]() behavior of "create user" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/WhiskAdminCliTestBase.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/WhiskAdminCliTestBase.scala index f7ee5d0acde..6c8d4f99051 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/WhiskAdminCliTestBase.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/WhiskAdminCliTestBase.scala @@ -20,7 +20,9 @@ package org.apache.openwhisk.core.database import common.{StreamLogging, WskActorSystem} import org.rogach.scallop.throwError import org.scalatest.concurrent.ScalaFutures -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FlatSpec, Matchers} +import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import org.apache.openwhisk.core.cli.{Conf, WhiskAdmin} import org.apache.openwhisk.core.database.test.DbUtils import org.apache.openwhisk.core.entity.WhiskAuthStore @@ -28,7 +30,7 @@ import org.apache.openwhisk.core.entity.WhiskAuthStore import scala.util.Random trait WhiskAdminCliTestBase - extends FlatSpec + extends AnyFlatSpec with WskActorSystem with DbUtils with StreamLogging diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlob.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlob.scala index 97ff656da75..08664f53c36 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlob.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlob.scala @@ -17,15 +17,15 @@ package org.apache.openwhisk.core.database.azblob -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import com.typesafe.config.ConfigFactory import org.apache.openwhisk.common.Logging import org.apache.openwhisk.core.database.{AttachmentStore, DocumentSerializer} -import org.scalatest.FlatSpec +import org.scalatest.flatspec.AnyFlatSpec import scala.reflect.ClassTag -trait AzureBlob extends FlatSpec { +trait AzureBlob extends AnyFlatSpec { def azureCdnConfig: String = "" def makeAzureStore[D <: DocumentSerializer: ClassTag]()(implicit actorSystem: ActorSystem, diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlobAttachmentStoreBehaviorBase.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlobAttachmentStoreBehaviorBase.scala index d8a4434dc04..ace46aefcc4 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlobAttachmentStoreBehaviorBase.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlobAttachmentStoreBehaviorBase.scala @@ -17,20 +17,20 @@ package org.apache.openwhisk.core.database.azblob -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import org.apache.openwhisk.common.Logging import org.apache.openwhisk.core.database.{AttachmentStore, DocumentSerializer} import org.apache.openwhisk.core.database.memory.{MemoryArtifactStoreBehaviorBase, MemoryArtifactStoreProvider} import org.apache.openwhisk.core.database.test.AttachmentStoreBehaviors import org.apache.openwhisk.core.database.test.behavior.ArtifactStoreAttachmentBehaviors import org.apache.openwhisk.core.entity.WhiskEntity -import org.scalatest.FlatSpec +import org.scalatest.flatspec.AnyFlatSpec import scala.reflect.ClassTag import scala.util.Random trait AzureBlobAttachmentStoreBehaviorBase - extends FlatSpec + extends AnyFlatSpec with MemoryArtifactStoreBehaviorBase with ArtifactStoreAttachmentBehaviors with AttachmentStoreBehaviors { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlobAttachmentStoreCDNTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlobAttachmentStoreCDNTests.scala index 98d0e2a78b8..e9894905a6a 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlobAttachmentStoreCDNTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlobAttachmentStoreCDNTests.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.core.database.azblob import org.apache.openwhisk.core.entity.WhiskEntity import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) class AzureBlobAttachmentStoreCDNTests extends AzureBlobAttachmentStoreBehaviorBase with AzureBlob { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlobAttachmentStoreITTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlobAttachmentStoreITTests.scala index 2986eea3285..12de9d7440e 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlobAttachmentStoreITTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlobAttachmentStoreITTests.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.core.database.azblob import org.apache.openwhisk.core.entity.WhiskEntity import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) class AzureBlobAttachmentStoreITTests extends AzureBlobAttachmentStoreBehaviorBase with AzureBlob { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlobConfigTest.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlobConfigTest.scala index ed7ae8cd055..83bdf31c87a 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlobConfigTest.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlobConfigTest.scala @@ -20,13 +20,14 @@ package org.apache.openwhisk.core.database.azblob import com.azure.storage.common.policy.RetryPolicyType import org.apache.openwhisk.core.ConfigKeys import org.junit.runner.RunWith -import org.scalatest.{FlatSpec, Matchers} -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import pureconfig._ import pureconfig.generic.auto._ @RunWith(classOf[JUnitRunner]) -class AzureBlobConfigTest extends FlatSpec with Matchers { +class AzureBlobConfigTest extends AnyFlatSpec with Matchers { behavior of "AzureBlobConfig" it should "use valid defaults for retry option" in { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CollectionResourceUsageTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CollectionResourceUsageTests.scala index dd267188c69..8f74efb5568 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CollectionResourceUsageTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CollectionResourceUsageTests.scala @@ -19,12 +19,13 @@ package org.apache.openwhisk.core.database.cosmosdb import org.apache.openwhisk.core.database.cosmosdb.CollectionResourceUsage.{indexHeader, quotaHeader, usageHeader} import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import org.apache.openwhisk.core.entity.size._ @RunWith(classOf[JUnitRunner]) -class CollectionResourceUsageTests extends FlatSpec with Matchers { +class CollectionResourceUsageTests extends AnyFlatSpec with Matchers { behavior of "CollectionInfo" it should "populate resource usage info" in { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBArtifactStoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBArtifactStoreTests.scala index a5c6fc995bd..1bf35a0c3db 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBArtifactStoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBArtifactStoreTests.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.core.database.cosmosdb import java.util.concurrent.CountDownLatch -import akka.stream.scaladsl.Source +import org.apache.pekko.stream.scaladsl.Source import com.typesafe.config.ConfigFactory import io.netty.util.ResourceLeakDetector import io.netty.util.ResourceLeakDetector.Level @@ -40,15 +40,15 @@ import org.apache.openwhisk.core.entity.{ WhiskPackage } import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner import spray.json.JsString import scala.concurrent.duration._ import scala.reflect.ClassTag @RunWith(classOf[JUnitRunner]) -class CosmosDBArtifactStoreTests extends FlatSpec with CosmosDBStoreBehaviorBase with ArtifactStoreBehavior { +class CosmosDBArtifactStoreTests extends AnyFlatSpec with CosmosDBStoreBehaviorBase with ArtifactStoreBehavior { override protected def maxAttachmentSizeWithoutAttachmentStore = 1.MB private var initialLevel: Level = _ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBAttachmentStoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBAttachmentStoreTests.scala index 5b2c9a156a2..99641a01cb4 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBAttachmentStoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBAttachmentStoreTests.scala @@ -18,8 +18,8 @@ package org.apache.openwhisk.core.database.cosmosdb import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner import org.apache.openwhisk.core.database.DocumentSerializer import org.apache.openwhisk.core.database.memory.MemoryAttachmentStoreProvider import org.apache.openwhisk.core.database.test.behavior.ArtifactStoreAttachmentBehaviors @@ -28,7 +28,7 @@ import scala.reflect.ClassTag @RunWith(classOf[JUnitRunner]) class CosmosDBAttachmentStoreTests - extends FlatSpec + extends AnyFlatSpec with CosmosDBStoreBehaviorBase with ArtifactStoreAttachmentBehaviors { override protected def getAttachmentStore[D <: DocumentSerializer: ClassTag]() = diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBConfigTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBConfigTests.scala index 979312e2866..7dd9384d059 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBConfigTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBConfigTests.scala @@ -18,14 +18,15 @@ package org.apache.openwhisk.core.database.cosmosdb import com.typesafe.config.ConfigFactory import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import com.microsoft.azure.cosmosdb.{ConnectionMode, ConnectionPolicy => JConnectionPolicy} import scala.collection.JavaConverters._ @RunWith(classOf[JUnitRunner]) -class CosmosDBConfigTests extends FlatSpec with Matchers { +class CosmosDBConfigTests extends AnyFlatSpec with Matchers { val globalConfig = ConfigFactory.defaultApplication() behavior of "CosmosDB Config" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBLeakTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBLeakTests.scala index 44efd15bfc6..029f8187d1f 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBLeakTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBLeakTests.scala @@ -16,7 +16,7 @@ */ package org.apache.openwhisk.core.database.cosmosdb -import akka.stream.scaladsl.{Sink, Source} +import org.apache.pekko.stream.scaladsl.{Sink, Source} import io.netty.util.ResourceLeakDetector import io.netty.util.ResourceLeakDetector.Level import org.apache.openwhisk.common.TransactionId @@ -31,8 +31,8 @@ import org.apache.openwhisk.core.entity.{ WhiskNamespace } import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner import scala.concurrent.duration.DurationInt @@ -41,7 +41,7 @@ import scala.concurrent.duration.DurationInt * By default this test is disabled */ @RunWith(classOf[JUnitRunner]) -class CosmosDBLeakTests extends FlatSpec with CosmosDBStoreBehaviorBase { +class CosmosDBLeakTests extends AnyFlatSpec with CosmosDBStoreBehaviorBase { behavior of s"CosmosDB leak" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBSoftDeleteTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBSoftDeleteTests.scala index 6cf262c9de2..33fe4858ba1 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBSoftDeleteTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBSoftDeleteTests.scala @@ -20,15 +20,15 @@ import org.apache.openwhisk.core.database.DocumentSerializer import org.apache.openwhisk.core.database.memory.MemoryAttachmentStoreProvider import org.apache.openwhisk.core.database.test.behavior.{ArtifactStoreCRUDBehaviors, ArtifactStoreQueryBehaviors} import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner import scala.reflect.ClassTag import scala.concurrent.duration._ @RunWith(classOf[JUnitRunner]) class CosmosDBSoftDeleteTests - extends FlatSpec + extends AnyFlatSpec with CosmosDBStoreBehaviorBase with ArtifactStoreCRUDBehaviors with ArtifactStoreQueryBehaviors { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBStoreBehaviorBase.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBStoreBehaviorBase.scala index 8ca9b14c60a..f67c57c2d85 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBStoreBehaviorBase.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBStoreBehaviorBase.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.database.cosmosdb -import org.scalatest.FlatSpec +import org.scalatest.flatspec.AnyFlatSpec import org.apache.openwhisk.core.database.test.behavior.ArtifactStoreBehaviorBase import org.apache.openwhisk.core.database.{ArtifactStore, AttachmentStore, DocumentSerializer} import org.apache.openwhisk.core.entity.{ @@ -32,7 +32,7 @@ import org.apache.openwhisk.core.entity.{ import scala.reflect.{classTag, ClassTag} import scala.util.Try -trait CosmosDBStoreBehaviorBase extends FlatSpec with ArtifactStoreBehaviorBase with CosmosDBTestSupport { +trait CosmosDBStoreBehaviorBase extends AnyFlatSpec with ArtifactStoreBehaviorBase with CosmosDBTestSupport { override def storeType = "CosmosDB" override lazy val storeAvailableCheck: Try[Any] = storeConfigTry diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBSupportTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBSupportTests.scala index 78de4240d78..c9c1b59cb7c 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBSupportTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBSupportTests.scala @@ -32,15 +32,16 @@ import org.apache.openwhisk.core.entity.{ } import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import scala.collection.JavaConverters._ import scala.concurrent.duration.DurationInt @RunWith(classOf[JUnitRunner]) class CosmosDBSupportTests - extends FlatSpec + extends AnyFlatSpec with CosmosDBTestSupport with MockFactory with Matchers diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBTestSupport.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBTestSupport.scala index 5ec166e1cd6..9de901fb0d6 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBTestSupport.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBTestSupport.scala @@ -18,7 +18,8 @@ package org.apache.openwhisk.core.database.cosmosdb import com.microsoft.azure.cosmosdb.{Database, SqlParameter, SqlParameterCollection, SqlQuerySpec} -import org.scalatest.{BeforeAndAfterAll, FlatSpecLike} +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpecLike import pureconfig._ import pureconfig.generic.auto._ import org.apache.openwhisk.core.ConfigKeys @@ -27,7 +28,7 @@ import org.apache.openwhisk.core.database.test.behavior.ArtifactStoreTestUtil.st import scala.collection.mutable.ListBuffer import scala.util.{Random, Try} -trait CosmosDBTestSupport extends FlatSpecLike with BeforeAndAfterAll with RxObservableImplicits { +trait CosmosDBTestSupport extends AnyFlatSpecLike with BeforeAndAfterAll with RxObservableImplicits { private val dbsToDelete = ListBuffer[Database]() lazy val storeConfigTry = Try { loadConfigOrThrow[CosmosDBConfig](ConfigKeys.cosmosdb) } diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBUtilTest.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBUtilTest.scala index 68f37b10694..56e76e33051 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBUtilTest.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBUtilTest.scala @@ -18,13 +18,15 @@ package org.apache.openwhisk.core.database.cosmosdb import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers, OptionValues} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.OptionValues +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import spray.json._ import org.apache.openwhisk.utils.JsHelpers @RunWith(classOf[JUnitRunner]) -class CosmosDBUtilTest extends FlatSpec with Matchers with OptionValues { +class CosmosDBUtilTest extends AnyFlatSpec with Matchers with OptionValues { behavior of "prepare field" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/IndexingPolicyTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/IndexingPolicyTests.scala index d739550a0fe..0d4e514c54f 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/IndexingPolicyTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/IndexingPolicyTests.scala @@ -20,11 +20,12 @@ package org.apache.openwhisk.core.database.cosmosdb import com.microsoft.azure.cosmosdb.DataType.String import com.microsoft.azure.cosmosdb.IndexKind.Range import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers @RunWith(classOf[JUnitRunner]) -class IndexingPolicyTests extends FlatSpec with Matchers { +class IndexingPolicyTests extends AnyFlatSpec with Matchers { behavior of "IndexingPolicy" it should "match same instance" in { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/ReferenceCountedTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/ReferenceCountedTests.scala index 78d8ad856b0..bde264d567b 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/ReferenceCountedTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/ReferenceCountedTests.scala @@ -18,11 +18,12 @@ package org.apache.openwhisk.core.database.cosmosdb import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers @RunWith(classOf[JUnitRunner]) -class ReferenceCountedTests extends FlatSpec with Matchers { +class ReferenceCountedTests extends AnyFlatSpec with Matchers { class CloseProbe extends AutoCloseable { var closed: Boolean = _ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/cache/CacheInvalidatorTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/cache/CacheInvalidatorTests.scala index 936f483c661..e48be134051 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/cache/CacheInvalidatorTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/cache/CacheInvalidatorTests.scala @@ -17,14 +17,15 @@ package org.apache.openwhisk.core.database.cosmosdb.cache import java.net.UnknownHostException -import akka.Done -import akka.actor.CoordinatedShutdown -import akka.kafka.testkit.scaladsl.ScalatestKafkaSpec +import org.apache.pekko.Done +import org.apache.pekko.actor.CoordinatedShutdown +import org.apache.pekko.kafka.testkit.scaladsl.ScalatestKafkaSpec import com.typesafe.config.ConfigFactory +import common.FreePortFinder import io.github.embeddedkafka.{EmbeddedKafka, EmbeddedKafkaConfig} import org.apache.kafka.common.KafkaException import org.apache.kafka.common.serialization.StringDeserializer -import org.apache.openwhisk.common.{AkkaLogging, TransactionId} +import org.apache.openwhisk.common.{PekkoLogging, TransactionId} import org.apache.openwhisk.core.database.{CacheInvalidationMessage, RemoteCacheInvalidation} import org.apache.openwhisk.core.database.cosmosdb.{CosmosDBArtifactStoreProvider, CosmosDBTestSupport} import org.apache.openwhisk.core.entity.{ @@ -38,30 +39,32 @@ import org.apache.openwhisk.core.entity.{ } import org.junit.runner.RunWith import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{Matchers, TryValues} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.TryValues +import org.scalatest.matchers.should.Matchers import scala.concurrent.duration._ import scala.util.Random @RunWith(classOf[JUnitRunner]) class CacheInvalidatorTests - extends ScalatestKafkaSpec(6061) + extends ScalatestKafkaSpec(0) with EmbeddedKafka with CosmosDBTestSupport with Matchers with ScalaFutures with TryValues { - private implicit val logging = new AkkaLogging(system.log) + private implicit val logging = new PekkoLogging(system.log) implicit override val patienceConfig: PatienceConfig = PatienceConfig(timeout = 300.seconds) - def createKafkaConfig: EmbeddedKafkaConfig = EmbeddedKafkaConfig(kafkaPort, zooKeeperPort) + implicit val embeddedKafkaConfig: EmbeddedKafkaConfig = + EmbeddedKafkaConfig(kafkaPort = FreePortFinder.freePort(), zooKeeperPort = FreePortFinder.freePort()) - override def bootstrapServers = s"localhost:$kafkaPort" + override def bootstrapServers = s"localhost:${embeddedKafkaConfig.kafkaPort}" override def setUp(): Unit = { - EmbeddedKafka.start()(createKafkaConfig) + EmbeddedKafka.start()(embeddedKafkaConfig) super.setUp() } @@ -72,7 +75,7 @@ class CacheInvalidatorTests behavior of "CosmosDB CacheInvalidation" - private val server = s"localhost:$kafkaPort" + private val server = s"localhost:${embeddedKafkaConfig.kafkaPort}" private var dbName: String = _ override def afterAll(): Unit = { @@ -103,8 +106,9 @@ class CacheInvalidatorTests //This should result in change feed trigger and event to kafka topic val topic = RemoteCacheInvalidation.cacheInvalidationTopic val msgs = - consumeNumberMessagesFromTopics(Set(topic), 1, timeout = 60.seconds)(createKafkaConfig, new StringDeserializer())( - topic) + consumeNumberMessagesFromTopics(Set(topic), 1, timeout = 60.seconds)( + embeddedKafkaConfig, + new StringDeserializer())(topic) CacheInvalidationMessage.parse(msgs.head).get.key.mainId shouldBe pkg.docid.asString @@ -164,7 +168,7 @@ class CacheInvalidatorTests private def startCacheInvalidator(): CacheInvalidator = { val tsconfig = ConfigFactory.parseString(s""" - |akka.kafka.producer { + |pekko.kafka.producer { | kafka-clients { | bootstrap.servers = "$server" | } @@ -182,7 +186,7 @@ class CacheInvalidatorTests } private def startCacheInvalidatorWithoutKafka(): CacheInvalidator = { val tsconfig = ConfigFactory.parseString(s""" - |akka.kafka.producer { + |pekko.kafka.producer { | kafka-clients { | #this config is missing | } @@ -200,7 +204,7 @@ class CacheInvalidatorTests } private def startCacheInvalidatorWithInvalidKafka(): CacheInvalidator = { val tsconfig = ConfigFactory.parseString(s""" - |akka.kafka.producer { + |pekko.kafka.producer { | kafka-clients { | bootstrap.servers = "localhost:9092" | } @@ -218,7 +222,7 @@ class CacheInvalidatorTests } private def startCacheInvalidatorWithoutCosmos(): CacheInvalidator = { val tsconfig = ConfigFactory.parseString(s""" - |akka.kafka.producer { + |pekko.kafka.producer { | kafka-clients { | bootstrap.servers = "$server" | } diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/cache/WhiskChangeEventObserverTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/cache/WhiskChangeEventObserverTests.scala index 6d369db7757..cbc91695f35 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/cache/WhiskChangeEventObserverTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/cache/WhiskChangeEventObserverTests.scala @@ -21,14 +21,15 @@ import common.StreamLogging import org.apache.openwhisk.core.database.CacheInvalidationMessage import org.apache.openwhisk.core.entity.CacheKey import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import spray.json.DefaultJsonProtocol import scala.collection.immutable.Seq @RunWith(classOf[JUnitRunner]) -class WhiskChangeEventObserverTests extends FlatSpec with Matchers with StreamLogging { +class WhiskChangeEventObserverTests extends AnyFlatSpec with Matchers with StreamLogging { import WhiskChangeEventObserver.instanceId behavior of "CosmosDB extract LSN from Session token" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/elasticsearch/ElasticSearchActivationStoreBehaviorBase.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/elasticsearch/ElasticSearchActivationStoreBehaviorBase.scala index a13ac8c7209..7f5e47a2c74 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/elasticsearch/ElasticSearchActivationStoreBehaviorBase.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/elasticsearch/ElasticSearchActivationStoreBehaviorBase.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.database.elasticsearch -import org.scalatest.FlatSpec +import org.scalatest.flatspec.AnyFlatSpec import org.apache.openwhisk.core.controller.test.WhiskAuthHelpers import org.apache.openwhisk.core.database.UserContext import org.apache.openwhisk.core.database.test.behavior.ActivationStoreBehaviorBase @@ -26,7 +26,7 @@ import org.testcontainers.elasticsearch.ElasticsearchContainer import pureconfig.loadConfigOrThrow import spray.json.{JsObject, JsString} -trait ElasticSearchActivationStoreBehaviorBase extends FlatSpec with ActivationStoreBehaviorBase { +trait ElasticSearchActivationStoreBehaviorBase extends AnyFlatSpec with ActivationStoreBehaviorBase { val imageName = loadConfigOrThrow[String]("whisk.elasticsearch.docker-image") val container = new ElasticsearchContainer(imageName) container.start() diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/elasticsearch/ElasticSearchActivationStoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/elasticsearch/ElasticSearchActivationStoreTests.scala index 6fcc8db85bb..e7ad5f16d32 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/elasticsearch/ElasticSearchActivationStoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/elasticsearch/ElasticSearchActivationStoreTests.scala @@ -20,26 +20,27 @@ package org.apache.openwhisk.core.database.elasticsearch import java.time.Instant import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.database.UserContext import org.apache.openwhisk.core.database.test.behavior.ActivationStoreBehavior import org.apache.openwhisk.core.entity.{EntityPath, WhiskActivation} import org.apache.openwhisk.utils.retry +import scala.concurrent.duration.DurationInt @RunWith(classOf[JUnitRunner]) class ElasticSearchActivationStoreTests - extends FlatSpec + extends AnyFlatSpec with ElasticSearchActivationStoreBehaviorBase with ActivationStoreBehavior { override def checkGetActivation(activation: WhiskActivation)(implicit transid: TransactionId): Unit = { - retry(super.checkGetActivation(activation), 10) + retry(super.checkGetActivation(activation), 10, Some(500.milliseconds)) } override def checkDeleteActivation(activation: WhiskActivation)(implicit transid: TransactionId): Unit = { - retry(super.checkDeleteActivation(activation), 10) + retry(super.checkDeleteActivation(activation), 10, Some(500.milliseconds)) } override def checkQueryActivations(namespace: String, diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/memory/MemoryArtifactStoreBehaviorBase.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/memory/MemoryArtifactStoreBehaviorBase.scala index 87f5ae4e8ee..925444ed6ff 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/memory/MemoryArtifactStoreBehaviorBase.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/memory/MemoryArtifactStoreBehaviorBase.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.database.memory -import org.scalatest.FlatSpec +import org.scalatest.flatspec.AnyFlatSpec import org.apache.openwhisk.core.database.{ArtifactStore, AttachmentStore, DocumentSerializer} import org.apache.openwhisk.core.database.test.behavior.ArtifactStoreBehaviorBase import org.apache.openwhisk.core.entity.{ @@ -31,7 +31,7 @@ import org.apache.openwhisk.core.entity.{ import scala.reflect.{classTag, ClassTag} -trait MemoryArtifactStoreBehaviorBase extends FlatSpec with ArtifactStoreBehaviorBase { +trait MemoryArtifactStoreBehaviorBase extends AnyFlatSpec with ArtifactStoreBehaviorBase { override def storeType = "Memory" override lazy val authStore = { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/memory/MemoryArtifactStoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/memory/MemoryArtifactStoreTests.scala index 9bc79809a2d..a9532d4919a 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/memory/MemoryArtifactStoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/memory/MemoryArtifactStoreTests.scala @@ -18,9 +18,9 @@ package org.apache.openwhisk.core.database.memory import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner import org.apache.openwhisk.core.database.test.behavior.ArtifactStoreBehavior @RunWith(classOf[JUnitRunner]) -class MemoryArtifactStoreTests extends FlatSpec with MemoryArtifactStoreBehaviorBase with ArtifactStoreBehavior +class MemoryArtifactStoreTests extends AnyFlatSpec with MemoryArtifactStoreBehaviorBase with ArtifactStoreBehavior diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/memory/MemoryAttachmentStoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/memory/MemoryAttachmentStoreTests.scala index c10395dfb85..0fa5a74d87a 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/memory/MemoryAttachmentStoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/memory/MemoryAttachmentStoreTests.scala @@ -19,14 +19,14 @@ package org.apache.openwhisk.core.database.memory import common.WskActorSystem import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner import org.apache.openwhisk.core.database.AttachmentStore import org.apache.openwhisk.core.database.test.AttachmentStoreBehaviors import org.apache.openwhisk.core.entity.WhiskEntity @RunWith(classOf[JUnitRunner]) -class MemoryAttachmentStoreTests extends FlatSpec with AttachmentStoreBehaviors with WskActorSystem { +class MemoryAttachmentStoreTests extends AnyFlatSpec with AttachmentStoreBehaviors with WskActorSystem { override val store: AttachmentStore = MemoryAttachmentStoreProvider.makeStore[WhiskEntity]() diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBArtifactStoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBArtifactStoreTests.scala index 24c62c10d3e..009f14cd580 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBArtifactStoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBArtifactStoreTests.scala @@ -19,8 +19,8 @@ package org.apache.openwhisk.core.database.mongodb import org.apache.openwhisk.core.database.test.behavior.ArtifactStoreBehavior import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -class MongoDBArtifactStoreTests extends FlatSpec with MongoDBStoreBehaviorBase with ArtifactStoreBehavior {} +class MongoDBArtifactStoreTests extends AnyFlatSpec with MongoDBStoreBehaviorBase with ArtifactStoreBehavior {} diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBAsyncStreamGraphTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBAsyncStreamGraphTests.scala index 7660f3cbc60..6320ac94376 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBAsyncStreamGraphTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBAsyncStreamGraphTests.scala @@ -19,25 +19,26 @@ package org.apache.openwhisk.core.database.mongodb import java.io.{ByteArrayInputStream, ByteArrayOutputStream, IOException, InputStream} -import akka.stream.scaladsl.{Keep, Sink, StreamConverters} -import akka.stream.testkit.TestSubscriber -import akka.util.ByteString +import org.apache.pekko.stream.scaladsl.{Keep, Sink, StreamConverters} +import org.apache.pekko.stream.testkit.TestSubscriber +import org.apache.pekko.util.ByteString import common.WskActorSystem import org.apache.commons.io.IOUtils import org.junit.runner.RunWith import org.mockito.ArgumentMatchers._ import org.mockito.Mockito._ import org.mongodb.scala.gridfs.helpers.AsyncStreamHelper -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import org.scalatest.concurrent.{IntegrationPatience, ScalaFutures} -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import org.scalatestplus.mockito.MockitoSugar import scala.util.Random @RunWith(classOf[JUnitRunner]) class MongoDBAsyncStreamGraphTests - extends FlatSpec + extends AnyFlatSpec with Matchers with ScalaFutures with WskActorSystem diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBAttachmentStoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBAttachmentStoreTests.scala index 31eb5932c37..92074a71c01 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBAttachmentStoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBAttachmentStoreTests.scala @@ -21,13 +21,16 @@ import org.apache.openwhisk.core.database.DocumentSerializer import org.apache.openwhisk.core.database.memory.MemoryAttachmentStoreProvider import org.apache.openwhisk.core.database.test.behavior.ArtifactStoreAttachmentBehaviors import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner import scala.reflect.ClassTag @RunWith(classOf[JUnitRunner]) -class MongoDBAttachmentStoreTests extends FlatSpec with MongoDBStoreBehaviorBase with ArtifactStoreAttachmentBehaviors { +class MongoDBAttachmentStoreTests + extends AnyFlatSpec + with MongoDBStoreBehaviorBase + with ArtifactStoreAttachmentBehaviors { override protected def getAttachmentStore[D <: DocumentSerializer: ClassTag]() = Some(MemoryAttachmentStoreProvider.makeStore[D]()) } diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBStoreBehaviorBase.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBStoreBehaviorBase.scala index 50825dd0933..22577a9fb69 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBStoreBehaviorBase.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBStoreBehaviorBase.scala @@ -20,14 +20,14 @@ package org.apache.openwhisk.core.database.mongodb import org.apache.openwhisk.core.database.test.behavior.ArtifactStoreBehaviorBase import org.apache.openwhisk.core.database.{ArtifactStore, AttachmentStore, DocumentSerializer} import org.apache.openwhisk.core.entity._ -import org.scalatest.FlatSpec +import org.scalatest.flatspec.AnyFlatSpec import org.testcontainers.containers.MongoDBContainer import pureconfig.loadConfigOrThrow import pureconfig.generic.auto._ import scala.reflect.{classTag, ClassTag} -trait MongoDBStoreBehaviorBase extends FlatSpec with ArtifactStoreBehaviorBase { +trait MongoDBStoreBehaviorBase extends AnyFlatSpec with ArtifactStoreBehaviorBase { val imageName = loadConfigOrThrow[String]("whisk.mongodb.docker-image") val container = new MongoDBContainer(imageName) container.start() diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBViewMapperTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBViewMapperTests.scala index 44b121b5b16..e1f6200cfa6 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBViewMapperTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBViewMapperTests.scala @@ -26,11 +26,13 @@ import org.mongodb.scala.bson.BsonDocument import org.mongodb.scala.bson.collection.immutable.Document import org.mongodb.scala.model.Filters.{equal => meq, _} import org.mongodb.scala.model.Sorts -import org.scalatest.{FlatSpec, Matchers, OptionValues} -import org.scalatest.junit.JUnitRunner +import org.scalatest.OptionValues +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -class MongoDBViewMapperTests extends FlatSpec with Matchers with OptionValues { +class MongoDBViewMapperTests extends AnyFlatSpec with Matchers with OptionValues { implicit class RichBson(val b: Bson) { def toDoc: BsonDocument = b.toBsonDocument(classOf[Document], MongoClient.DEFAULT_CODEC_REGISTRY) } diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/s3/CloudFrontSignerTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/s3/CloudFrontSignerTests.scala index 53cf97b041e..904c4222449 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/s3/CloudFrontSignerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/s3/CloudFrontSignerTests.scala @@ -16,19 +16,21 @@ */ package org.apache.openwhisk.core.database.s3 -import akka.http.scaladsl.model.Uri.Path +import org.apache.pekko.http.scaladsl.model.Uri.Path import com.typesafe.config.ConfigFactory import java.time.Instant import org.apache.openwhisk.core.ConfigKeys import org.apache.openwhisk.core.database.s3.S3AttachmentStoreProvider.S3Config import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers, OptionValues} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.OptionValues +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import pureconfig._ import pureconfig.generic.auto._ @RunWith(classOf[JUnitRunner]) -class CloudFrontSignerTests extends FlatSpec with Matchers with OptionValues { +class CloudFrontSignerTests extends AnyFlatSpec with Matchers with OptionValues { val qt = "\"\"\"" val privateKey = diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStoreAwsTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStoreAwsTests.scala index 7c595c1398f..a27e9fde7c7 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStoreAwsTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStoreAwsTests.scala @@ -18,7 +18,7 @@ package org.apache.openwhisk.core.database.s3 import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import org.apache.openwhisk.core.entity.WhiskEntity @RunWith(classOf[JUnitRunner]) diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStoreBehaviorBase.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStoreBehaviorBase.scala index aadab4458fd..6d3c4cffae4 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStoreBehaviorBase.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStoreBehaviorBase.scala @@ -17,8 +17,8 @@ package org.apache.openwhisk.core.database.s3 -import akka.actor.ActorSystem -import org.scalatest.FlatSpec +import org.apache.pekko.actor.ActorSystem +import org.scalatest.flatspec.AnyFlatSpec import org.apache.openwhisk.common.Logging import org.apache.openwhisk.core.database.{AttachmentStore, DocumentSerializer} import org.apache.openwhisk.core.database.memory.{MemoryArtifactStoreBehaviorBase, MemoryArtifactStoreProvider} @@ -30,7 +30,7 @@ import scala.reflect.ClassTag import scala.util.Random trait S3AttachmentStoreBehaviorBase - extends FlatSpec + extends AnyFlatSpec with MemoryArtifactStoreBehaviorBase with ArtifactStoreAttachmentBehaviors with AttachmentStoreBehaviors { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStoreCloudFrontTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStoreCloudFrontTests.scala index 5e14a37df98..0602d146d27 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStoreCloudFrontTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStoreCloudFrontTests.scala @@ -18,7 +18,7 @@ package org.apache.openwhisk.core.database.s3 import org.apache.openwhisk.core.entity.WhiskEntity import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) class S3AttachmentStoreCloudFrontTests extends S3AttachmentStoreBehaviorBase with S3Aws { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStoreMinioTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStoreMinioTests.scala index 0403fd88b73..dc4010f81ff 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStoreMinioTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStoreMinioTests.scala @@ -18,7 +18,7 @@ package org.apache.openwhisk.core.database.s3 import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import org.apache.openwhisk.core.entity.WhiskEntity @RunWith(classOf[JUnitRunner]) diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3Aws.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3Aws.scala index 952598d19b8..dd962855cef 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3Aws.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3Aws.scala @@ -17,15 +17,15 @@ package org.apache.openwhisk.core.database.s3 -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import com.typesafe.config.ConfigFactory -import org.scalatest.FlatSpec +import org.scalatest.flatspec.AnyFlatSpec import org.apache.openwhisk.common.Logging import org.apache.openwhisk.core.database.{AttachmentStore, DocumentSerializer} import scala.reflect.ClassTag -trait S3Aws extends FlatSpec { +trait S3Aws extends AnyFlatSpec { def cloudFrontConfig: String = "" @@ -34,7 +34,7 @@ trait S3Aws extends FlatSpec { val config = ConfigFactory.parseString(s""" |whisk { | s3 { - | alpakka { + | pekko-connectors { | aws { | credentials { | provider = static diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3Minio.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3Minio.scala index 1a3bd83e299..6205237bcbb 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3Minio.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3Minio.scala @@ -20,26 +20,27 @@ package org.apache.openwhisk.core.database.s3 import java.net.ServerSocket import actionContainers.ActionContainer -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import com.amazonaws.auth.{AWSStaticCredentialsProvider, BasicAWSCredentials} import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration import com.amazonaws.services.s3.AmazonS3ClientBuilder import com.typesafe.config.ConfigFactory import common.{SimpleExec, StreamLogging} -import org.scalatest.{BeforeAndAfterAll, FlatSpec} +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpec import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.core.database.{AttachmentStore, DocumentSerializer} import scala.concurrent.duration._ import scala.reflect.ClassTag -trait S3Minio extends FlatSpec with BeforeAndAfterAll with StreamLogging { +trait S3Minio extends AnyFlatSpec with BeforeAndAfterAll with StreamLogging { def makeS3Store[D <: DocumentSerializer: ClassTag]()(implicit actorSystem: ActorSystem, logging: Logging): AttachmentStore = { val config = ConfigFactory.parseString(s""" |whisk { | s3 { - | alpakka { + | pekko-connectors { | aws { | credentials { | provider = static diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3WithPrefixTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3WithPrefixTests.scala index ee512c12a8d..9b8026aa8d7 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3WithPrefixTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/s3/S3WithPrefixTests.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.database.s3 import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import org.apache.openwhisk.core.database.s3.S3AttachmentStoreProvider.S3Config import org.apache.openwhisk.core.entity.WhiskEntity diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/test/AttachmentCompatibilityTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/test/AttachmentCompatibilityTests.scala index 01fd303ff84..43482e32bf2 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/test/AttachmentCompatibilityTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/test/AttachmentCompatibilityTests.scala @@ -20,14 +20,16 @@ package org.apache.openwhisk.core.database.test import java.io.ByteArrayInputStream import java.util.Base64 -import akka.http.scaladsl.model.{ContentType, StatusCodes} -import akka.stream.scaladsl.{Source, StreamConverters} -import akka.util.ByteString +import org.apache.pekko.http.scaladsl.model.{ContentType, StatusCodes} +import org.apache.pekko.stream.scaladsl.{Source, StreamConverters} +import org.apache.pekko.util.ByteString import common.{StreamLogging, WskActorSystem} import org.junit.runner.RunWith import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import pureconfig._ import pureconfig.generic.auto._ import spray.json._ @@ -45,7 +47,7 @@ import scala.reflect.classTag @RunWith(classOf[JUnitRunner]) class AttachmentCompatibilityTests - extends FlatSpec + extends AnyFlatSpec with Matchers with ScalaFutures with BeforeAndAfterEach diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/test/AttachmentStoreBehaviors.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/test/AttachmentStoreBehaviors.scala index b0c537deb0d..e9351bc23f4 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/test/AttachmentStoreBehaviors.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/test/AttachmentStoreBehaviors.scala @@ -19,12 +19,14 @@ package org.apache.openwhisk.core.database.test import java.io.ByteArrayInputStream -import akka.http.scaladsl.model.ContentTypes -import akka.stream.scaladsl.{Sink, Source, StreamConverters} -import akka.util.{ByteString, ByteStringBuilder} +import org.apache.pekko.http.scaladsl.model.ContentTypes +import org.apache.pekko.stream.scaladsl.{Sink, Source, StreamConverters} +import org.apache.pekko.util.{ByteString, ByteStringBuilder} import common.{StreamLogging, WskActorSystem} import org.scalatest.concurrent.ScalaFutures -import org.scalatest.{BeforeAndAfterAll, FlatSpec, Matchers} +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.database.{AttachmentStore, NoDocumentException} import org.apache.openwhisk.core.entity.DocId @@ -41,7 +43,7 @@ trait AttachmentStoreBehaviors with StreamLogging with WskActorSystem with BeforeAndAfterAll { - this: FlatSpec => + this: AnyFlatSpec => //Bring in sync the timeout used by ScalaFutures and DBUtils implicit override val patienceConfig: PatienceConfig = PatienceConfig(timeout = dbOpTimeout) diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/test/AttachmentSupportTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/test/AttachmentSupportTests.scala index 28937d3de6e..f96e07c4811 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/test/AttachmentSupportTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/test/AttachmentSupportTests.scala @@ -17,21 +17,22 @@ package org.apache.openwhisk.core.database.test -import akka.http.scaladsl.model.Uri -import akka.stream.scaladsl.Source -import akka.util.CompactByteString +import org.apache.pekko.http.scaladsl.model.Uri +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.util.CompactByteString import common.WskActorSystem import org.junit.runner.RunWith import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.database.{AttachmentSupport, InliningConfig} import org.apache.openwhisk.core.entity.WhiskEntity import org.apache.openwhisk.core.entity.size._ @RunWith(classOf[JUnitRunner]) -class AttachmentSupportTests extends FlatSpec with Matchers with ScalaFutures with WskActorSystem { +class AttachmentSupportTests extends AnyFlatSpec with Matchers with ScalaFutures with WskActorSystem { behavior of "Attachment inlining" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/test/BatcherTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/test/BatcherTests.scala index c194b0fbf9f..725cc3a6ceb 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/test/BatcherTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/test/BatcherTests.scala @@ -22,8 +22,9 @@ import java.util.concurrent.atomic.AtomicInteger import common.{LoggedFunction, WskActorSystem} import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import org.apache.openwhisk.core.database.Batcher import org.apache.openwhisk.utils.retry @@ -32,7 +33,7 @@ import scala.concurrent.duration._ import scala.concurrent.{Await, Future, Promise} @RunWith(classOf[JUnitRunner]) -class BatcherTests extends FlatSpec with Matchers with WskActorSystem { +class BatcherTests extends AnyFlatSpec with Matchers with WskActorSystem { def await[V](f: Future[V]) = Await.result(f, 10.seconds) @@ -41,7 +42,7 @@ class BatcherTests extends FlatSpec with Matchers with WskActorSystem { val promiseDelay = 100.milliseconds def resolveDelayed(p: Promise[Unit], delay: FiniteDuration = promiseDelay) = - akka.pattern.after(delay, actorSystem.scheduler) { + org.apache.pekko.pattern.after(delay, actorSystem.scheduler) { p.success(()) Future.successful(()) } diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/test/CacheConcurrencyTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/test/CacheConcurrencyTests.scala index 0026df89944..7bb5047937b 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/test/CacheConcurrencyTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/test/CacheConcurrencyTests.scala @@ -22,9 +22,9 @@ import java.util.concurrent.Executors import org.junit.runner.RunWith import org.scalatest.BeforeAndAfterEach -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner -import akka.http.scaladsl.model.StatusCodes.NotFound +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner +import org.apache.pekko.http.scaladsl.model.StatusCodes.NotFound import common.TestUtils._ import common._ import common.rest.WskRestOperations @@ -36,7 +36,7 @@ import scala.concurrent.ExecutionContext @RunWith(classOf[JUnitRunner]) class CacheConcurrencyTests - extends FlatSpec + extends AnyFlatSpec with WskTestHelpers with WskActorSystem with BeforeAndAfterEach diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/test/CleanUpActivationsTest.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/test/CleanUpActivationsTest.scala index ac07f76087a..34497da6147 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/test/CleanUpActivationsTest.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/test/CleanUpActivationsTest.scala @@ -25,12 +25,12 @@ import scala.concurrent.duration.FiniteDuration import scala.language.implicitConversions import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner -import akka.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.StatusCodes import common.StreamLogging import common.TestUtils import common.WaitFor @@ -41,7 +41,7 @@ import spray.json._ @RunWith(classOf[JUnitRunner]) class CleanUpActivationsTest - extends FlatSpec + extends AnyFlatSpec with Matchers with ScalaFutures with WskActorSystem diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/test/CouchDbRestClientTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/test/CouchDbRestClientTests.scala index a29f3a2ae55..837208ae361 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/test/CouchDbRestClientTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/test/CouchDbRestClientTests.scala @@ -25,14 +25,14 @@ import scala.concurrent.duration.DurationInt import scala.util._ import org.junit.runner.RunWith import org.scalatest.BeforeAndAfterAll -import org.scalatest.FlatSpec -import org.scalatest.Matchers +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import akka.actor.Props -import akka.http.scaladsl.model._ -import akka.stream.scaladsl._ -import akka.util.ByteString +import org.scalatestplus.junit.JUnitRunner +import org.apache.pekko.actor.Props +import org.apache.pekko.http.scaladsl.model._ +import org.apache.pekko.stream.scaladsl._ +import org.apache.pekko.util.ByteString import common.StreamLogging import common.WskActorSystem import pureconfig._ @@ -45,7 +45,7 @@ import org.apache.openwhisk.test.http.RESTProxy @RunWith(classOf[JUnitRunner]) class CouchDbRestClientTests - extends FlatSpec + extends AnyFlatSpec with Matchers with ScalaFutures with BeforeAndAfterAll diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/test/DatabaseScriptTestUtils.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/test/DatabaseScriptTestUtils.scala index 81790b28d83..0c8f413ebfe 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/test/DatabaseScriptTestUtils.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/test/DatabaseScriptTestUtils.scala @@ -19,10 +19,10 @@ package org.apache.openwhisk.core.database.test import scala.concurrent.duration.DurationInt import scala.io.Source -import org.scalatest.Matchers +import org.scalatest.matchers.should.Matchers import org.scalatest.concurrent.IntegrationPatience import org.scalatest.concurrent.ScalaFutures -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import common.WaitFor import common.WhiskProperties import pureconfig._ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/test/DbUtils.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/test/DbUtils.scala index 853836a3dac..0dce266dbed 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/test/DbUtils.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/test/DbUtils.scala @@ -21,9 +21,9 @@ import java.util.Base64 import java.util.concurrent.TimeoutException import java.util.concurrent.atomic.AtomicInteger -import akka.http.scaladsl.model.ContentType -import akka.stream.scaladsl.Source -import akka.util.ByteString +import org.apache.pekko.http.scaladsl.model.ContentType +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.util.ByteString import org.scalatest.Assertions import spray.json.DefaultJsonProtocol._ import spray.json._ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/test/DocumentHandlerTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/test/DocumentHandlerTests.scala index 725162b4a29..616623d3133 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/test/DocumentHandlerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/test/DocumentHandlerTests.scala @@ -22,8 +22,10 @@ import java.util.concurrent.atomic.AtomicInteger import common.WskActorSystem import org.junit.runner.RunWith import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers, OptionValues} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.OptionValues +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import spray.json.DefaultJsonProtocol._ import spray.json._ import org.apache.openwhisk.common.TransactionId @@ -35,7 +37,7 @@ import org.apache.openwhisk.core.entity._ import scala.concurrent.Future @RunWith(classOf[JUnitRunner]) -class DocumentHandlerTests extends FlatSpec with Matchers with ScalaFutures with OptionValues with WskActorSystem { +class DocumentHandlerTests extends AnyFlatSpec with Matchers with ScalaFutures with OptionValues with WskActorSystem { val cnt = new AtomicInteger(0) def transid() = TransactionId(cnt.incrementAndGet().toString) diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/test/ExtendedCouchDbRestClient.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/test/ExtendedCouchDbRestClient.scala index df843b94b6f..4b8ff9b0098 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/test/ExtendedCouchDbRestClient.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/test/ExtendedCouchDbRestClient.scala @@ -19,8 +19,8 @@ package org.apache.openwhisk.core.database.test import scala.concurrent.Future -import akka.actor.ActorSystem -import akka.http.scaladsl.model._ +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model._ import spray.json._ import spray.json.DefaultJsonProtocol._ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/test/MultipleReadersSingleWriterCacheTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/test/MultipleReadersSingleWriterCacheTests.scala index e0d5933b9bc..b41a5a31d4b 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/test/MultipleReadersSingleWriterCacheTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/test/MultipleReadersSingleWriterCacheTests.scala @@ -24,9 +24,9 @@ import scala.concurrent.Future import scala.concurrent.duration.DurationInt import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import common.StreamLogging import common.WskActorSystem @@ -37,7 +37,7 @@ import org.apache.openwhisk.core.entity.CacheKey @RunWith(classOf[JUnitRunner]) class MultipleReadersSingleWriterCacheTests - extends FlatSpec + extends AnyFlatSpec with Matchers with MultipleReadersSingleWriterCache[String, String] with WskActorSystem diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/test/RemoveLogsTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/test/RemoveLogsTests.scala index c2c89170b0b..acecb4394b1 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/test/RemoveLogsTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/test/RemoveLogsTests.scala @@ -22,8 +22,8 @@ import java.time.Instant import java.time.temporal.ChronoUnit import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner import common.StreamLogging import common.TestUtils @@ -37,7 +37,7 @@ import org.apache.openwhisk.core.entity.WhiskActivation import org.apache.openwhisk.core.entity.ActivationLogs @RunWith(classOf[JUnitRunner]) -class RemoveLogsTests extends FlatSpec with DatabaseScriptTestUtils with StreamLogging with WskActorSystem { +class RemoveLogsTests extends AnyFlatSpec with DatabaseScriptTestUtils with StreamLogging with WskActorSystem { val designDocPath = WhiskProperties .getFileRelativeToWhiskHome("ansible/files/logCleanup_design_document_for_activations_db.json") diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/test/ReplicatorTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/test/ReplicatorTests.scala index 13387f55fc2..a263d501370 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/test/ReplicatorTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/test/ReplicatorTests.scala @@ -24,12 +24,12 @@ import scala.concurrent.duration._ import scala.language.implicitConversions import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner -import akka.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.StatusCodes import common.StreamLogging import common.TestUtils import common.WaitFor @@ -40,7 +40,7 @@ import spray.json.DefaultJsonProtocol._ @RunWith(classOf[JUnitRunner]) class ReplicatorTests - extends FlatSpec + extends AnyFlatSpec with Matchers with ScalaFutures with WskActorSystem diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/test/behavior/ActivationStoreBehaviorBase.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/test/behavior/ActivationStoreBehaviorBase.scala index 3b7a66a88e2..f05e4ade4f5 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/test/behavior/ActivationStoreBehaviorBase.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/test/behavior/ActivationStoreBehaviorBase.scala @@ -25,7 +25,9 @@ import org.apache.openwhisk.core.database.{ActivationStore, CacheChangeNotificat import org.apache.openwhisk.core.database.test.behavior.ArtifactStoreTestUtil.storeAvailable import org.apache.openwhisk.core.entity._ import org.scalatest.concurrent.{IntegrationPatience, ScalaFutures} -import org.scalatest.{BeforeAndAfterEach, FlatSpec, Matchers, Outcome} +import org.scalatest.{BeforeAndAfterEach, Outcome} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import scala.collection.mutable.ListBuffer import scala.concurrent.Await @@ -35,7 +37,7 @@ import scala.language.postfixOps import scala.util.{Random, Try} trait ActivationStoreBehaviorBase - extends FlatSpec + extends AnyFlatSpec with ScalaFutures with Matchers with StreamLogging diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/test/behavior/ArtifactStoreAttachmentBehaviors.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/test/behavior/ArtifactStoreAttachmentBehaviors.scala index 6d4a2470109..71d44ac5a25 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/test/behavior/ArtifactStoreAttachmentBehaviors.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/test/behavior/ArtifactStoreAttachmentBehaviors.scala @@ -20,10 +20,10 @@ package org.apache.openwhisk.core.database.test.behavior import java.io.ByteArrayOutputStream import java.util.Base64 -import akka.http.scaladsl.model.{ContentTypes, Uri} -import akka.stream.IOResult -import akka.stream.scaladsl.{Sink, StreamConverters} -import akka.util.{ByteString, ByteStringBuilder} +import org.apache.pekko.http.scaladsl.model.{ContentTypes, Uri} +import org.apache.pekko.stream.IOResult +import org.apache.pekko.stream.scaladsl.{Sink, StreamConverters} +import org.apache.pekko.util.{ByteString, ByteStringBuilder} import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.database.{AttachmentSupport, CacheChangeNotification, NoDocumentException} import org.apache.openwhisk.core.entity.Attachments.{Attached, Attachment, Inline} diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/test/behavior/ArtifactStoreBehaviorBase.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/test/behavior/ArtifactStoreBehaviorBase.scala index 4a9510d356c..a1b9ca61467 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/test/behavior/ArtifactStoreBehaviorBase.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/test/behavior/ArtifactStoreBehaviorBase.scala @@ -21,7 +21,9 @@ import java.time.Instant import common.{StreamLogging, WskActorSystem} import org.scalatest.concurrent.{IntegrationPatience, ScalaFutures} -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FlatSpec, Matchers} +import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import spray.json.{JsObject, JsValue} import org.apache.openwhisk.common.{TransactionId, WhiskInstants} import org.apache.openwhisk.core.database.memory.MemoryAttachmentStore @@ -35,7 +37,7 @@ import org.apache.openwhisk.utils.JsHelpers import scala.util.{Random, Try} trait ArtifactStoreBehaviorBase - extends FlatSpec + extends AnyFlatSpec with ScalaFutures with Matchers with StreamLogging diff --git a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ActivationCompatTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ActivationCompatTests.scala index fd8872d8f22..4410f736d94 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ActivationCompatTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ActivationCompatTests.scala @@ -33,15 +33,16 @@ import org.apache.openwhisk.core.entity.{ WhiskActivation } import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import spray.json._ import scala.concurrent.duration._ import org.apache.openwhisk.core.entity.size._ @RunWith(classOf[JUnitRunner]) -class ActivationCompatTests extends FlatSpec with Matchers with WhiskInstants with DefaultJsonProtocol { +class ActivationCompatTests extends AnyFlatSpec with Matchers with WhiskInstants with DefaultJsonProtocol { behavior of "ActivationResponse" val activationResponseJs = """ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ActivationResponseTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ActivationResponseTests.scala index bbfc19715be..2213d475a14 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ActivationResponseTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ActivationResponseTests.scala @@ -19,9 +19,9 @@ package org.apache.openwhisk.core.entity.test import scala.Vector import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import spray.json._ import org.apache.openwhisk.common.PrintStreamLogging import org.apache.openwhisk.core.entity.ActivationResponse._ @@ -31,7 +31,7 @@ import scala.Left import scala.Right @RunWith(classOf[JUnitRunner]) -class ActivationResponseTests extends FlatSpec with Matchers { +class ActivationResponseTests extends AnyFlatSpec with Matchers { behavior of "ActivationResponse" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ControllerInstanceIdTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ControllerInstanceIdTests.scala index 9c96bb8a027..f615b6c031a 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ControllerInstanceIdTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ControllerInstanceIdTests.scala @@ -18,16 +18,16 @@ package org.apache.openwhisk.core.entity.test import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import org.apache.openwhisk.core.entity.{ControllerInstanceId, InstanceId} import spray.json.{JsObject, JsString} import scala.util.Success @RunWith(classOf[JUnitRunner]) -class ControllerInstanceIdTests extends FlatSpec with Matchers { +class ControllerInstanceIdTests extends AnyFlatSpec with Matchers { behavior of "ControllerInstanceId" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/DatastoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/DatastoreTests.scala index c1c8ae330c4..26752c6c756 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/DatastoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/DatastoreTests.scala @@ -21,8 +21,8 @@ import scala.concurrent.Await import org.junit.runner.RunWith import org.scalatest.BeforeAndAfterEach import org.scalatest.BeforeAndAfterAll -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatestplus.junit.JUnitRunner import common.{StreamLogging, WskActorSystem} import org.apache.openwhisk.common.WhiskInstants import org.mockito.Mockito._ @@ -34,7 +34,7 @@ import org.apache.openwhisk.core.entity._ @RunWith(classOf[JUnitRunner]) class DatastoreTests - extends FlatSpec + extends AnyFlatSpec with BeforeAndAfterEach with BeforeAndAfterAll with WskActorSystem diff --git a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecHelpers.scala b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecHelpers.scala index 7182741cf8f..46a4d508a8f 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecHelpers.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecHelpers.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.entity.test -import org.scalatest.Matchers +import org.scalatest.matchers.should.Matchers import org.scalatest.Suite import common.StreamLogging import common.WskActorSystem diff --git a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecManifestTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecManifestTests.scala index 35735ddc1ea..da584b0ffa9 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecManifestTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecManifestTests.scala @@ -21,8 +21,9 @@ import java.util.concurrent.TimeUnit import common.{StreamLogging, WskActorSystem} import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import spray.json._ import spray.json.DefaultJsonProtocol._ import org.apache.openwhisk.core.entity.ExecManifest @@ -34,7 +35,7 @@ import scala.concurrent.duration.FiniteDuration import scala.util.Success @RunWith(classOf[JUnitRunner]) -class ExecManifestTests extends FlatSpec with WskActorSystem with StreamLogging with Matchers { +class ExecManifestTests extends AnyFlatSpec with WskActorSystem with StreamLogging with Matchers { behavior of "ExecManifest" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecTests.scala index 09bed32aaee..95a69729699 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecTests.scala @@ -17,12 +17,14 @@ package org.apache.openwhisk.core.entity.test -import akka.http.scaladsl.model.ContentTypes +import org.apache.pekko.http.scaladsl.model.ContentTypes import common.StreamLogging import spray.json._ import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import org.apache.openwhisk.core.WhiskConfig import org.apache.openwhisk.core.entity.Attachments.{Attached, Inline} import org.apache.openwhisk.core.entity.ExecManifest.ImageName @@ -38,7 +40,7 @@ import org.apache.openwhisk.core.entity.{ import scala.collection.mutable @RunWith(classOf[JUnitRunner]) -class ExecTests extends FlatSpec with Matchers with StreamLogging with BeforeAndAfterAll { +class ExecTests extends AnyFlatSpec with Matchers with StreamLogging with BeforeAndAfterAll { behavior of "exec deserialization" val config = new WhiskConfig(ExecManifest.requiredProperties) diff --git a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/InvokerInstanceIdTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/InvokerInstanceIdTests.scala index fb3a35c2cbc..6ba3b88a625 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/InvokerInstanceIdTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/InvokerInstanceIdTests.scala @@ -20,14 +20,15 @@ package org.apache.openwhisk.core.entity.test import org.apache.openwhisk.core.entity.size.SizeInt import org.apache.openwhisk.core.entity.{ByteSize, InstanceId, InvokerInstanceId} import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import spray.json.{JsArray, JsNumber, JsObject, JsString} import scala.util.Success @RunWith(classOf[JUnitRunner]) -class InvokerInstanceIdTests extends FlatSpec with Matchers { +class InvokerInstanceIdTests extends AnyFlatSpec with Matchers { behavior of "InvokerInstanceIdTests" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ParameterEncryptionTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ParameterEncryptionTests.scala index 5aeea91693a..e4b193554cf 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ParameterEncryptionTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ParameterEncryptionTests.scala @@ -20,13 +20,15 @@ import java.security.InvalidAlgorithmParameterException import org.apache.openwhisk.core.entity._ import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfter, FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.BeforeAndAfter +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import spray.json.DefaultJsonProtocol._ import spray.json._ @RunWith(classOf[JUnitRunner]) -class ParameterEncryptionTests extends FlatSpec with Matchers with BeforeAndAfter { +class ParameterEncryptionTests extends AnyFlatSpec with Matchers with BeforeAndAfter { val k128 = "ra1V6AfOYAv0jCzEdufIFA==" val k256 = "j5rLzhtxwzPyUVUy8/p8XJmBoKeDoSzNJP1SITJEY9E=" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/SchemaTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/SchemaTests.scala index c62d2bd6fff..dadaec9c6ff 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/SchemaTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/SchemaTests.scala @@ -24,9 +24,9 @@ import scala.util.Failure import scala.util.Try import org.junit.runner.RunWith import org.scalatest.BeforeAndAfter -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import spray.json._ import spray.json.DefaultJsonProtocol._ import org.apache.openwhisk.common.TransactionId @@ -39,7 +39,7 @@ import org.apache.openwhisk.http.Messages import org.apache.openwhisk.utils.JsHelpers @RunWith(classOf[JUnitRunner]) -class SchemaTests extends FlatSpec with BeforeAndAfter with ExecHelpers with Matchers { +class SchemaTests extends AnyFlatSpec with BeforeAndAfter with ExecHelpers with Matchers { behavior of "Privilege" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/SizeTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/SizeTests.scala index 3a98c591381..bcc5263fd6c 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/SizeTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/SizeTests.scala @@ -20,15 +20,15 @@ package org.apache.openwhisk.core.entity.test import scala.language.postfixOps import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import spray.json._ import org.apache.openwhisk.core.entity.size.SizeInt import org.apache.openwhisk.core.entity.ByteSize @RunWith(classOf[JUnitRunner]) -class SizeTests extends FlatSpec with Matchers { +class SizeTests extends AnyFlatSpec with Matchers { behavior of "Size Entity" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ViewTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ViewTests.scala index df3b4e3207c..cac501d27b1 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ViewTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ViewTests.scala @@ -23,8 +23,11 @@ import java.time.Instant import scala.concurrent.Await import scala.language.postfixOps import org.junit.runner.RunWith -import org.scalatest._ -import org.scalatest.junit.JUnitRunner +import org.scalatest.BeforeAndAfterEach +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import common.StreamLogging import common.WskActorSystem import org.apache.openwhisk.core.controller.test.WhiskAuthHelpers @@ -35,7 +38,7 @@ import org.apache.openwhisk.core.entity._ @RunWith(classOf[JUnitRunner]) class ViewTests - extends FlatSpec + extends AnyFlatSpec with BeforeAndAfterEach with BeforeAndAfterAll with Matchers diff --git a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/WhiskEntityTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/WhiskEntityTests.scala index 25bae832c62..ea2bd8d960e 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/WhiskEntityTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/WhiskEntityTests.scala @@ -18,9 +18,9 @@ package org.apache.openwhisk.core.entity.test import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import org.apache.openwhisk.core.entity.EntityPath import org.apache.openwhisk.core.entity.EntityName import org.apache.openwhisk.core.entity.WhiskAction @@ -45,7 +45,7 @@ import org.apache.openwhisk.core.entity.WhiskRule import org.apache.openwhisk.core.database.DocumentTypeMismatchException @RunWith(classOf[JUnitRunner]) -class WhiskEntityTests extends FlatSpec with ExecHelpers with Matchers { +class WhiskEntityTests extends AnyFlatSpec with ExecHelpers with Matchers { val namespace = EntityPath("testspace") val name = EntityName("testname") diff --git a/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/ContainerMessageConsumerTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/ContainerMessageConsumerTests.scala index 670b812b3f6..a547e24aed9 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/ContainerMessageConsumerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/ContainerMessageConsumerTests.scala @@ -17,8 +17,8 @@ package org.apache.openwhisk.core.invoker.test -import akka.actor.ActorSystem -import akka.testkit.{TestKit, TestProbe} +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.testkit.{TestKit, TestProbe} import common.StreamLogging import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.core.connector.ContainerCreationError._ @@ -36,8 +36,10 @@ import org.apache.openwhisk.http.Messages import org.apache.openwhisk.utils.{retry => utilRetry} import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FlatSpecLike, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import java.nio.charset.StandardCharsets import scala.concurrent.Future @@ -47,7 +49,7 @@ import scala.util.Try @RunWith(classOf[JUnitRunner]) class ContainerMessageConsumerTests extends TestKit(ActorSystem("ContainerMessageConsumer")) - with FlatSpecLike + with AnyFlatSpecLike with Matchers with BeforeAndAfterEach with BeforeAndAfterAll diff --git a/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/DefaultInvokerServerTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/DefaultInvokerServerTests.scala index ea5e73b50d9..f98821ee5e6 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/DefaultInvokerServerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/DefaultInvokerServerTests.scala @@ -17,11 +17,11 @@ package org.apache.openwhisk.core.invoker.test -import akka.http.scaladsl.model.StatusCodes.{OK, Unauthorized} -import akka.http.scaladsl.model.headers.BasicHttpCredentials -import akka.http.scaladsl.server.Route -import akka.http.scaladsl.testkit.ScalatestRouteTest -import akka.http.scaladsl.unmarshalling.Unmarshal +import org.apache.pekko.http.scaladsl.model.StatusCodes.{OK, Unauthorized} +import org.apache.pekko.http.scaladsl.model.headers.BasicHttpCredentials +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.testkit.ScalatestRouteTest +import org.apache.pekko.http.scaladsl.unmarshalling.Unmarshal import common.StreamLogging import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.containerpool.v2.{NotSupportedPoolState, TotalContainerPoolState} @@ -30,8 +30,10 @@ import org.apache.openwhisk.core.invoker.{DefaultInvokerServer, InvokerCore} import org.apache.openwhisk.http.BasicHttpService import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FlatSpec, Matchers} -import org.scalatest.junit.JUnitRunner +import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import scala.concurrent.Future @@ -40,7 +42,7 @@ import scala.concurrent.Future */ @RunWith(classOf[JUnitRunner]) class DefaultInvokerServerTests - extends FlatSpec + extends AnyFlatSpec with BeforeAndAfterEach with BeforeAndAfterAll with ScalatestRouteTest diff --git a/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/FPCInvokerServerTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/FPCInvokerServerTests.scala index cf298fb5fcf..04e59c37623 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/FPCInvokerServerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/FPCInvokerServerTests.scala @@ -17,11 +17,11 @@ package org.apache.openwhisk.core.invoker.test -import akka.http.scaladsl.model.StatusCodes.{OK, Unauthorized} -import akka.http.scaladsl.model.headers.BasicHttpCredentials -import akka.http.scaladsl.server.Route -import akka.http.scaladsl.testkit.ScalatestRouteTest -import akka.http.scaladsl.unmarshalling.Unmarshal +import org.apache.pekko.http.scaladsl.model.StatusCodes.{OK, Unauthorized} +import org.apache.pekko.http.scaladsl.model.headers.BasicHttpCredentials +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.testkit.ScalatestRouteTest +import org.apache.pekko.http.scaladsl.unmarshalling.Unmarshal import common.StreamLogging import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.containerpool.v2.{NotSupportedPoolState, TotalContainerPoolState} @@ -30,8 +30,10 @@ import org.apache.openwhisk.core.invoker.{FPCInvokerServer, InvokerCore} import org.apache.openwhisk.http.BasicHttpService import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FlatSpec, Matchers} -import org.scalatest.junit.JUnitRunner +import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import scala.concurrent.Future @@ -40,7 +42,7 @@ import scala.concurrent.Future */ @RunWith(classOf[JUnitRunner]) class FPCInvokerServerTests - extends FlatSpec + extends AnyFlatSpec with BeforeAndAfterEach with BeforeAndAfterAll with ScalatestRouteTest diff --git a/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/InstanceIdAssignerTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/InstanceIdAssignerTests.scala index 112d1190714..018825556f0 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/InstanceIdAssignerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/InstanceIdAssignerTests.scala @@ -20,12 +20,14 @@ package org.apache.openwhisk.core.invoker.test import common.StreamLogging import org.apache.curator.test.TestingServer import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterEach, FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.BeforeAndAfterEach +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import org.apache.openwhisk.core.invoker.InstanceIdAssigner @RunWith(classOf[JUnitRunner]) -class InstanceIdAssignerTests extends FlatSpec with Matchers with StreamLogging with BeforeAndAfterEach { +class InstanceIdAssignerTests extends AnyFlatSpec with Matchers with StreamLogging with BeforeAndAfterEach { behavior of "Id Assignment" private var zkServer: TestingServer = _ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/InvokerBootUpTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/InvokerBootUpTests.scala index c8e4b4edfe5..d04407585d1 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/InvokerBootUpTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/InvokerBootUpTests.scala @@ -18,8 +18,8 @@ package org.apache.openwhisk.core.invoker.test import java.nio.charset.StandardCharsets -import akka.actor.ActorSystem -import akka.testkit.TestKit +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.testkit.TestKit import common.WskTestHelpers import org.apache.openwhisk.common.InvokerState.Healthy import org.apache.openwhisk.core.ConfigKeys @@ -31,8 +31,9 @@ import org.apache.openwhisk.core.etcd.EtcdKV.{InstanceKeys, InvokerKeys} import org.apache.openwhisk.core.etcd.{EtcdClient, EtcdConfig} import org.junit.runner.RunWith import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, FlatSpecLike} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpecLike import pureconfig.loadConfigOrThrow import org.apache.openwhisk.core.entity.size._ @@ -44,7 +45,7 @@ import pureconfig.generic.auto._ @RunWith(classOf[JUnitRunner]) class InvokerBootUpTests extends TestKit(ActorSystem("SchedulerFlow")) - with FlatSpecLike + with AnyFlatSpecLike with BeforeAndAfterAll with WskTestHelpers with ScalaFutures { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/NamespaceBlacklistTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/NamespaceBlacklistTests.scala index 686c172b189..137d7b85881 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/NamespaceBlacklistTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/NamespaceBlacklistTests.scala @@ -20,8 +20,9 @@ package org.apache.openwhisk.core.invoker.test import common.{StreamLogging, WskActorSystem} import org.junit.runner.RunWith import org.scalatest.concurrent.{IntegrationPatience, ScalaFutures} -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import spray.json._ import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.database.test.DbUtils @@ -33,7 +34,7 @@ import scala.concurrent.duration._ @RunWith(classOf[JUnitRunner]) class NamespaceBlacklistTests - extends FlatSpec + extends AnyFlatSpec with Matchers with DbUtils with ScalaFutures diff --git a/tests/src/test/scala/org/apache/openwhisk/core/limits/ActionLimitsTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/limits/ActionLimitsTests.scala index 0001e1225c1..dfc8aae1c59 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/limits/ActionLimitsTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/limits/ActionLimitsTests.scala @@ -17,8 +17,8 @@ package org.apache.openwhisk.core.limits -import akka.http.scaladsl.model.StatusCodes.PayloadTooLarge -import akka.http.scaladsl.model.StatusCodes.BadGateway +import org.apache.pekko.http.scaladsl.model.StatusCodes.PayloadTooLarge +import org.apache.pekko.http.scaladsl.model.StatusCodes.BadGateway import java.io.File import java.io.PrintWriter import java.time.Instant @@ -26,7 +26,7 @@ import java.time.Instant import scala.concurrent.duration.{Duration, DurationInt} import scala.language.postfixOps import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common.ActivationResult import common.TestHelpers import common.TestUtils diff --git a/tests/src/test/scala/org/apache/openwhisk/core/limits/ConcurrencyTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/limits/ConcurrencyTests.scala index adeef2b87ff..eef7fb3396a 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/limits/ConcurrencyTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/limits/ConcurrencyTests.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.limits -import akka.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.StatusCodes import common._ import common.rest.WskRestOperations import org.apache.openwhisk.core.ConfigKeys @@ -25,7 +25,7 @@ import org.apache.openwhisk.core.containerpool.ContainerPoolConfig import org.apache.openwhisk.core.entity.MemoryLimit import org.apache.openwhisk.core.entity.size._ import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import pureconfig._ import pureconfig.generic.auto._ @@ -47,7 +47,7 @@ class ConcurrencyTests extends TestHelpers with WskTestHelpers with WskActorSyst val concurrentAction = TestUtils.getTestActionFilename("concurrent.js") //NOTE: this test will only succeed if: - // whisk.container-pool.akka-client = "true" (only the akka client properly handles concurrent requests to action containers) + // whisk.container-pool.pekko-client = "true" (only the pekko client properly handles concurrent requests to action containers) // whisk.container-factory.container-args.extra-args.env.0 = "__OW_ALLOW_CONCURRENT=true" (only action containers that tolerate concurrency can be tested - this enables concurrency in nodejs runtime) behavior of "Action concurrency limits" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/limits/MaxActionDurationTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/limits/MaxActionDurationTests.scala index 167bcc363e0..5d718108ab1 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/limits/MaxActionDurationTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/limits/MaxActionDurationTests.scala @@ -21,7 +21,7 @@ import java.io.File import scala.concurrent.duration.DurationInt import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common.{ConcurrencyHelpers, TestHelpers, TestUtils, WskActorSystem, WskProps, WskTestHelpers} import common.rest.WskRestOperations import org.apache.openwhisk.core.entity._ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/loadBalancer/test/FPCPoolBalancerTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/loadBalancer/test/FPCPoolBalancerTests.scala index 5a93d1b99d4..74f8c4d00b4 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/loadBalancer/test/FPCPoolBalancerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/loadBalancer/test/FPCPoolBalancerTests.scala @@ -17,9 +17,9 @@ package org.apache.openwhisk.core.loadBalancer.test -import akka.actor.{ActorRef, ActorRefFactory, ActorSystem, Props} -import akka.http.scaladsl.Http -import akka.testkit.TestProbe +import org.apache.pekko.actor.{ActorRef, ActorRefFactory, ActorSystem, Props} +import org.apache.pekko.http.scaladsl.Http +import org.apache.pekko.testkit.TestProbe import common.{StreamLogging, WskActorSystem} import org.apache.openwhisk.common.InvokerState.{Healthy, Offline, Unhealthy} import org.apache.openwhisk.common.{InvokerHealth, Logging, TransactionId} @@ -38,8 +38,10 @@ import org.apache.openwhisk.utils.{retry => utilRetry} import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterEach, FlatSpecLike, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.BeforeAndAfterEach +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import pureconfig._ import pureconfig.generic.auto._ @@ -51,7 +53,7 @@ import scala.util.Try @RunWith(classOf[JUnitRunner]) class FPCPoolBalancerTests - extends FlatSpecLike + extends AnyFlatSpecLike with Matchers with StreamLogging with ExecHelpers @@ -249,7 +251,7 @@ class FPCPoolBalancerTests val rpcPort4 = 19090 val rpcPort5 = 19091 val rpcPort6 = 19092 - val akkaPort = 0 + val pekkoPort = 0 val mockConsumer = new TestConnector("fake", 4, true) val messageProvider = fakeMessageProvider(mockConsumer) val clusterName1 = loadConfigOrThrow[String](ConfigKeys.whiskClusterName) @@ -257,22 +259,22 @@ class FPCPoolBalancerTests etcd.put( s"$clusterName1/scheduler/0", - SchedulerStates(SchedulerInstanceId("0"), queueSize = 0, SchedulerEndpoints(host, rpcPort1, akkaPort)).serialize) + SchedulerStates(SchedulerInstanceId("0"), queueSize = 0, SchedulerEndpoints(host, rpcPort1, pekkoPort)).serialize) etcd.put( s"$clusterName1/scheduler/1", - SchedulerStates(SchedulerInstanceId("1"), queueSize = 0, SchedulerEndpoints(host, rpcPort2, akkaPort)).serialize) + SchedulerStates(SchedulerInstanceId("1"), queueSize = 0, SchedulerEndpoints(host, rpcPort2, pekkoPort)).serialize) etcd.put( s"$clusterName1/scheduler/2", - SchedulerStates(SchedulerInstanceId("2"), queueSize = 0, SchedulerEndpoints(host, rpcPort3, akkaPort)).serialize) + SchedulerStates(SchedulerInstanceId("2"), queueSize = 0, SchedulerEndpoints(host, rpcPort3, pekkoPort)).serialize) etcd.put( s"$clusterName2/scheduler/3", - SchedulerStates(SchedulerInstanceId("3"), queueSize = 0, SchedulerEndpoints(host, rpcPort4, akkaPort)).serialize) + SchedulerStates(SchedulerInstanceId("3"), queueSize = 0, SchedulerEndpoints(host, rpcPort4, pekkoPort)).serialize) etcd.put( s"$clusterName2/scheduler/4", - SchedulerStates(SchedulerInstanceId("4"), queueSize = 0, SchedulerEndpoints(host, rpcPort5, akkaPort)).serialize) + SchedulerStates(SchedulerInstanceId("4"), queueSize = 0, SchedulerEndpoints(host, rpcPort5, pekkoPort)).serialize) etcd.put( s"$clusterName2/scheduler/5", - SchedulerStates(SchedulerInstanceId("5"), queueSize = 0, SchedulerEndpoints(host, rpcPort6, akkaPort)).serialize) + SchedulerStates(SchedulerInstanceId("5"), queueSize = 0, SchedulerEndpoints(host, rpcPort6, pekkoPort)).serialize) val poolBalancer = new FPCPoolBalancer( whiskConfig, diff --git a/tests/src/test/scala/org/apache/openwhisk/core/loadBalancer/test/InvokerSupervisionTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/loadBalancer/test/InvokerSupervisionTests.scala index 2cf0ef3f3dc..9dba344e76a 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/loadBalancer/test/InvokerSupervisionTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/loadBalancer/test/InvokerSupervisionTests.scala @@ -24,22 +24,22 @@ import scala.concurrent.Future import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory import org.scalatest.BeforeAndAfterAll -import org.scalatest.FlatSpecLike -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner -import akka.actor.ActorRef -import akka.actor.ActorRefFactory -import akka.actor.ActorSystem -import akka.actor.FSM -import akka.actor.FSM.CurrentState -import akka.actor.FSM.SubscribeTransitionCallBack -import akka.actor.FSM.Transition -import akka.pattern.ask -import akka.testkit.ImplicitSender -import akka.testkit.TestFSMRef -import akka.testkit.TestKit -import akka.testkit.TestProbe -import akka.util.Timeout +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner +import org.apache.pekko.actor.ActorRef +import org.apache.pekko.actor.ActorRefFactory +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.actor.FSM +import org.apache.pekko.actor.FSM.CurrentState +import org.apache.pekko.actor.FSM.SubscribeTransitionCallBack +import org.apache.pekko.actor.FSM.Transition +import org.apache.pekko.pattern.ask +import org.apache.pekko.testkit.ImplicitSender +import org.apache.pekko.testkit.TestFSMRef +import org.apache.pekko.testkit.TestKit +import org.apache.pekko.testkit.TestProbe +import org.apache.pekko.util.Timeout import common.{LoggedFunction, StreamLogging} import org.apache.openwhisk.common.InvokerState.{Healthy, Offline, Unhealthy, Unresponsive} import org.apache.openwhisk.common.{InvokerHealth, InvokerState, TransactionId} @@ -62,7 +62,7 @@ import org.apache.openwhisk.core.entity.ControllerInstanceId class InvokerSupervisionTests extends TestKit(ActorSystem("InvokerSupervision")) with ImplicitSender - with FlatSpecLike + with AnyFlatSpecLike with Matchers with BeforeAndAfterAll with MockFactory diff --git a/tests/src/test/scala/org/apache/openwhisk/core/loadBalancer/test/ShardingContainerPoolBalancerTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/loadBalancer/test/ShardingContainerPoolBalancerTests.scala index 2fb70088c9b..2d8c9d6efdf 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/loadBalancer/test/ShardingContainerPoolBalancerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/loadBalancer/test/ShardingContainerPoolBalancerTests.scala @@ -17,19 +17,19 @@ package org.apache.openwhisk.core.loadBalancer.test -import akka.actor.ActorRef -import akka.actor.ActorRefFactory -import akka.actor.ActorSystem -import akka.testkit.TestProbe +import org.apache.pekko.actor.ActorRef +import org.apache.pekko.actor.ActorRefFactory +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.testkit.TestProbe import common.{StreamLogging, WhiskProperties} import java.nio.charset.StandardCharsets import org.apache.openwhisk.common.InvokerState.{Healthy, Offline, Unhealthy} import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory -import org.scalatest.junit.JUnitRunner -import org.scalatest.FlatSpec -import org.scalatest.Matchers +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import scala.concurrent.Await import scala.concurrent.Future @@ -76,7 +76,7 @@ import org.apache.openwhisk.core.loadBalancer._ */ @RunWith(classOf[JUnitRunner]) class ShardingContainerPoolBalancerTests - extends FlatSpec + extends AnyFlatSpec with Matchers with StreamLogging with ExecHelpers diff --git a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/FPCSchedulerFlowTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/FPCSchedulerFlowTests.scala index 3b26571cc48..712fabef608 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/FPCSchedulerFlowTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/FPCSchedulerFlowTests.scala @@ -20,8 +20,8 @@ package org.apache.openwhisk.core.scheduler import java.nio.charset.StandardCharsets import java.util.concurrent.TimeUnit -import akka.actor.ActorSystem -import akka.testkit.{TestKit, TestProbe} +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.testkit.{TestKit, TestProbe} import com.ibm.etcd.api.Event.EventType import com.ibm.etcd.client.kv.WatchUpdate import common.rest.WskRestOperations @@ -42,8 +42,9 @@ import org.apache.openwhisk.http.Messages import org.apache.openwhisk.utils.retry import org.junit.runner.RunWith import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, FlatSpecLike} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpecLike import pureconfig.loadConfigOrThrow import spray.json.DefaultJsonProtocol._ import spray.json._ @@ -60,7 +61,7 @@ import scala.util.control.Breaks._ @RunWith(classOf[JUnitRunner]) class FPCSchedulerFlowTests extends TestKit(ActorSystem("SchedulerFlow")) - with FlatSpecLike + with AnyFlatSpecLike with BeforeAndAfterAll with WskTestHelpers with ScalaFutures { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/FPCSchedulerServerTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/FPCSchedulerServerTests.scala index 26dc3386991..daca6532ee0 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/FPCSchedulerServerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/FPCSchedulerServerTests.scala @@ -17,19 +17,21 @@ package org.apache.openwhisk.core.scheduler -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.model.StatusCodes._ -import akka.http.scaladsl.model.headers.BasicHttpCredentials -import akka.http.scaladsl.server.Route -import akka.http.scaladsl.testkit.ScalatestRouteTest +import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import org.apache.pekko.http.scaladsl.model.StatusCodes._ +import org.apache.pekko.http.scaladsl.model.headers.BasicHttpCredentials +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.testkit.ScalatestRouteTest import common.StreamLogging import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.connector.StatusData import org.apache.openwhisk.core.entity.{ActivationId, SchedulerInstanceId} import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import spray.json.DefaultJsonProtocol._ import spray.json._ @@ -40,7 +42,7 @@ import scala.concurrent.Future */ @RunWith(classOf[JUnitRunner]) class FPCSchedulerServerTests - extends FlatSpec + extends AnyFlatSpec with BeforeAndAfterEach with BeforeAndAfterAll with ScalatestRouteTest diff --git a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/container/test/ContainerManagerTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/container/test/ContainerManagerTests.scala index 2581bcfefa9..a2db5a0e5ce 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/container/test/ContainerManagerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/container/test/ContainerManagerTests.scala @@ -17,9 +17,9 @@ package org.apache.openwhisk.core.scheduler.container.test -import akka.actor.FSM.{CurrentState, SubscribeTransitionCallBack} -import akka.actor.{ActorRef, ActorRefFactory, ActorSystem} -import akka.testkit.{ImplicitSender, TestKit, TestProbe} +import org.apache.pekko.actor.FSM.{CurrentState, SubscribeTransitionCallBack} +import org.apache.pekko.actor.{ActorRef, ActorRefFactory, ActorSystem} +import org.apache.pekko.testkit.{ImplicitSender, TestKit, TestProbe} import com.ibm.etcd.api.{KeyValue, RangeResponse} import common.{StreamLogging, WskActorSystem} import org.apache.openwhisk.common.InvokerState.{Healthy, Unhealthy} @@ -55,8 +55,10 @@ import org.apache.openwhisk.core.{ConfigKeys, WhiskConfig} import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FlatSpecLike, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import pureconfig.loadConfigOrThrow import spray.json.{JsArray, JsBoolean, JsString} import pureconfig.generic.auto._ @@ -70,7 +72,7 @@ import scala.concurrent.duration.{FiniteDuration, _} class ContainerManagerTests extends TestKit(ActorSystem("ContainerManager")) with ImplicitSender - with FlatSpecLike + with AnyFlatSpecLike with ScalaFutures with Matchers with MockFactory @@ -1069,6 +1071,13 @@ class ContainerManagerTests system.actorOf(ContainerManager .props(factory(mockJobManager), mockMessaging(Some(receiver.ref)), testsid, mockEtcd, config, mockWatcher.ref)) + // Consume warmUp messages for all invokers + (0 to 2).foreach { i => + receiver.expectMsgPF() { + case msg: String if msg.contains("warmUp") && msg.contains(s"invoker$i") => true + } + } + val msg = ContainerDeletionMessage( TransactionId.containerDeletion, testInvocationNamespace, @@ -1081,12 +1090,11 @@ class ContainerManagerTests val expectedMsgs = invokers.map(i => s"invoker${i.id.instance}-$msg") - receiver.expectMsgPF() { - case msg: String if msg.contains("warmUp") => true - case msg: String => expectedMsgs.contains(msg) - case msg => - println(s"unexpected message: $msg") - fail() + // Expect all 3 deletion messages + expectedMsgs.foreach { expectedMsg => + receiver.expectMsgPF() { + case msg: String if msg == expectedMsg => true + } } } @@ -1489,7 +1497,7 @@ class ContainerManagerTests @RunWith(classOf[JUnitRunner]) class ContainerManager2Tests - extends FlatSpecLike + extends AnyFlatSpecLike with Matchers with StreamLogging with ExecHelpers diff --git a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/container/test/CreationJobManagerTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/container/test/CreationJobManagerTests.scala index 61e8199b7ca..aa2a0895a6c 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/container/test/CreationJobManagerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/container/test/CreationJobManagerTests.scala @@ -17,8 +17,8 @@ package org.apache.openwhisk.core.scheduler.container.test -import akka.actor.{ActorRef, ActorRefFactory, ActorSystem, Props} -import akka.testkit.{ImplicitSender, TestActorRef, TestKit, TestProbe} +import org.apache.pekko.actor.{ActorRef, ActorRefFactory, ActorSystem, Props} +import org.apache.pekko.testkit.{ImplicitSender, TestActorRef, TestKit, TestProbe} import com.ibm.etcd.client.{EtcdClient => Client} import common.StreamLogging import org.apache.openwhisk.common.TransactionId @@ -35,8 +35,10 @@ import org.apache.openwhisk.core.service.{RegisterData, UnregisterData} import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FlatSpecLike, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import java.util.concurrent.TimeUnit import scala.concurrent.duration.{DurationInt, FiniteDuration} @@ -46,7 +48,7 @@ import scala.concurrent.{ExecutionContextExecutor, Future} class CreationJobManagerTests extends TestKit(ActorSystem("CreationJobManager")) with ImplicitSender - with FlatSpecLike + with AnyFlatSpecLike with ScalaFutures with Matchers with MockFactory diff --git a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/grpc/test/ActivationServiceImplTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/grpc/test/ActivationServiceImplTests.scala index b2042f256c9..9e9a05a345f 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/grpc/test/ActivationServiceImplTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/grpc/test/ActivationServiceImplTests.scala @@ -17,8 +17,8 @@ package org.apache.openwhisk.core.scheduler.grpc.test -import akka.actor.{Actor, ActorSystem, Props} -import akka.testkit.{ImplicitSender, TestKit} +import org.apache.pekko.actor.{Actor, ActorSystem, Props} +import org.apache.pekko.testkit.{ImplicitSender, TestKit} import common.StreamLogging import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.core.WarmUp.warmUpAction @@ -35,8 +35,10 @@ import org.apache.openwhisk.core.scheduler.queue.{ } import org.apache.openwhisk.grpc.{FetchRequest, FetchResponse, RescheduleRequest, RescheduleResponse} import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FlatSpecLike, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import org.apache.openwhisk.core.scheduler.grpc.{ActivationResponse, GetActivation} import org.scalatest.concurrent.ScalaFutures import spray.json.JsonParser.ParsingException @@ -49,7 +51,7 @@ class ActivationServiceImplTests extends TestKit(ActorSystem("ActivationService")) with CommonVariable with ImplicitSender - with FlatSpecLike + with AnyFlatSpecLike with Matchers with BeforeAndAfterAll with BeforeAndAfterEach diff --git a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/ContainerCounterTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/ContainerCounterTests.scala index 7b6cbefbed7..5d5ff145f98 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/ContainerCounterTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/ContainerCounterTests.scala @@ -20,8 +20,8 @@ package org.apache.openwhisk.core.scheduler.queue.test import java.{lang, util} import java.util.concurrent.Executor -import akka.actor.ActorSystem -import akka.testkit.{TestKit, TestProbe} +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.testkit.{TestKit, TestProbe} import com.google.protobuf.ByteString import com.ibm.etcd.api.Event.EventType import com.ibm.etcd.api.{Event, KeyValue, LeaseKeepAliveResponse, ResponseHeader, TxnResponse} @@ -46,8 +46,9 @@ import org.apache.openwhisk.utils.retry import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory import org.scalatest.concurrent.ScalaFutures -import org.scalatest.{FlatSpecLike, Matchers} -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import scala.concurrent.Future import scala.concurrent.duration._ @@ -55,7 +56,7 @@ import scala.concurrent.duration._ @RunWith(classOf[JUnitRunner]) class ContainerCounterTests extends TestKit(ActorSystem("ContainerCounter")) - with FlatSpecLike + with AnyFlatSpecLike with Matchers with MockFactory with ScalaFutures diff --git a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/ElasticSearchDurationCheckResultFormatTest.scala b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/ElasticSearchDurationCheckResultFormatTest.scala index fe28e73ca48..45fd972e444 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/ElasticSearchDurationCheckResultFormatTest.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/ElasticSearchDurationCheckResultFormatTest.scala @@ -20,12 +20,13 @@ package org.apache.openwhisk.core.scheduler.queue.test import org.apache.openwhisk.core.scheduler.queue.{DurationCheckResult, ElasticSearchDurationCheckResultFormat} import org.junit.runner.RunWith import org.scalatest.concurrent.ScalaFutures -import org.scalatest.{FlatSpec, Matchers} -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import spray.json._ @RunWith(classOf[JUnitRunner]) -class ElasticSearchDurationCheckResultFormatTest extends FlatSpec with Matchers with ScalaFutures { +class ElasticSearchDurationCheckResultFormatTest extends AnyFlatSpec with Matchers with ScalaFutures { behavior of "ElasticSearchDurationCheckResultFormatTest" val serde = new ElasticSearchDurationCheckResultFormat() diff --git a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/ElasticSearchDurationCheckerTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/ElasticSearchDurationCheckerTests.scala index 4f6d33e2756..2e23b22bb0d 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/ElasticSearchDurationCheckerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/ElasticSearchDurationCheckerTests.scala @@ -34,7 +34,9 @@ import org.apache.openwhisk.core.scheduler.queue.{DurationCheckResult, ElasticSe import org.elasticsearch.client.RestClientBuilder.HttpClientConfigCallback import org.junit.runner.RunWith import org.scalatest.concurrent.ScalaFutures -import org.scalatest.{BeforeAndAfter, BeforeAndAfterAll, FlatSpec, Matchers} +import org.scalatest.{BeforeAndAfter, BeforeAndAfterAll} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import org.scalatestplus.junit.JUnitRunner import pureconfig.generic.auto._ import pureconfig.loadConfigOrThrow @@ -52,7 +54,7 @@ import scala.concurrent.duration._ */ @RunWith(classOf[JUnitRunner]) class ElasticSearchDurationCheckerTests - extends FlatSpec + extends AnyFlatSpec with Matchers with ScalaFutures with WskTestHelpers diff --git a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/MemoryQueueFlowTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/MemoryQueueFlowTests.scala index 6bcc3d21d2a..4aba9747b86 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/MemoryQueueFlowTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/MemoryQueueFlowTests.scala @@ -17,9 +17,9 @@ package org.apache.openwhisk.core.scheduler.queue.test -import akka.actor.ActorRef -import akka.actor.FSM.{CurrentState, StateTimeout, SubscribeTransitionCallBack, Transition} -import akka.testkit.{TestActor, TestFSMRef, TestProbe} +import org.apache.pekko.actor.ActorRef +import org.apache.pekko.actor.FSM.{CurrentState, StateTimeout, SubscribeTransitionCallBack, Transition} +import org.apache.pekko.testkit.{TestActor, TestFSMRef, TestProbe} import com.sksamuel.elastic4s.http.{search => _} import org.apache.openwhisk.common.GracefulShutdown import org.apache.openwhisk.common.time.{Clock, SystemClock} @@ -40,9 +40,12 @@ import org.apache.openwhisk.core.service._ import org.apache.openwhisk.http.Messages.{namespaceLimitUnderZero, tooManyConcurrentRequests} import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory -import org.scalatest._ +import org.scalatest.BeforeAndAfterEach +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import spray.json.{JsObject, JsString} import java.time.Instant @@ -66,7 +69,7 @@ class FakeClock extends Clock { @RunWith(classOf[JUnitRunner]) class MemoryQueueFlowTests extends MemoryQueueTestsFixture - with FlatSpecLike + with AnyFlatSpecLike with ScalaFutures with Matchers with MockFactory @@ -721,6 +724,8 @@ class MemoryQueueFlowTests fsm ! messages(0) expectInitialData(watcher, dataMgmtService) + fsm ! testInitialDataStorageResult + probe.expectMsg(Transition(fsm, Uninitialized, Running)) clock.plusSeconds(FiniteDuration(retentionTimeout, MILLISECONDS).toSeconds) diff --git a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/MemoryQueueTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/MemoryQueueTests.scala index 8f3d69f50ad..3cddf66874b 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/MemoryQueueTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/MemoryQueueTests.scala @@ -20,11 +20,11 @@ package org.apache.openwhisk.core.scheduler.queue.test import java.time.Instant import java.util.concurrent.Executor import java.{lang, util} -import akka.actor.ActorRef -import akka.actor.FSM.{CurrentState, StateTimeout, SubscribeTransitionCallBack, Transition} -import akka.pattern.ask -import akka.testkit.{ImplicitSender, TestActor, TestFSMRef, TestKit, TestProbe} -import akka.util.Timeout +import org.apache.pekko.actor.ActorRef +import org.apache.pekko.actor.FSM.{CurrentState, StateTimeout, SubscribeTransitionCallBack, Transition} +import org.apache.pekko.pattern.ask +import org.apache.pekko.testkit.{ImplicitSender, TestActor, TestFSMRef, TestKit, TestProbe} +import org.apache.pekko.util.Timeout import com.google.protobuf.ByteString import com.ibm.etcd.api.Event.EventType import com.ibm.etcd.api._ @@ -51,9 +51,13 @@ import org.apache.openwhisk.core.scheduler.queue._ import org.apache.openwhisk.core.service._ import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory -import org.scalatest._ +import org.scalatest.BeforeAndAfter +import org.scalatest.BeforeAndAfterEach +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import spray.json.{JsObject, JsString} import scala.collection.immutable.Queue @@ -66,7 +70,7 @@ import scala.language.{higherKinds, postfixOps} class MemoryQueueTests extends MemoryQueueTestsFixture with ImplicitSender - with FlatSpecLike + with AnyFlatSpecLike with ScalaFutures with Matchers with MockFactory diff --git a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/MemoryQueueTestsFixture.scala b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/MemoryQueueTestsFixture.scala index 8142d86ede7..ded6d4f4b6d 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/MemoryQueueTestsFixture.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/MemoryQueueTestsFixture.scala @@ -19,8 +19,8 @@ package org.apache.openwhisk.core.scheduler.queue.test import java.time.Instant -import akka.actor.{ActorRef, ActorSystem} -import akka.testkit.{ImplicitSender, TestKit, TestProbe} +import org.apache.pekko.actor.{ActorRef, ActorSystem} +import org.apache.pekko.testkit.{ImplicitSender, TestKit, TestProbe} import com.sksamuel.elastic4s.http import com.sksamuel.elastic4s.http.ElasticDsl.{avgAgg, boolQuery, matchQuery, rangeQuery, search} import com.sksamuel.elastic4s.http._ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/QueueManagerTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/QueueManagerTests.scala index 80ab594ef8b..088b0d66ada 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/QueueManagerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/QueueManagerTests.scala @@ -19,10 +19,10 @@ package org.apache.openwhisk.core.scheduler.queue.test import java.time.{Clock, Instant} import java.util.concurrent.atomic.AtomicInteger -import akka.actor.{Actor, ActorIdentity, ActorRef, ActorRefFactory, ActorSystem, Identify, Props} -import akka.pattern.ask -import akka.testkit.{ImplicitSender, TestActor, TestActorRef, TestKit, TestProbe} -import akka.util.Timeout +import org.apache.pekko.actor.{Actor, ActorIdentity, ActorRef, ActorRefFactory, ActorSystem, Identify, Props} +import org.apache.pekko.pattern.ask +import org.apache.pekko.testkit.{ImplicitSender, TestActor, TestActorRef, TestKit, TestProbe} +import org.apache.pekko.util.Timeout import com.ibm.etcd.api.{KeyValue, RangeResponse} import common.{LoggedFunction, StreamLogging} import org.apache.openwhisk.common.{GracefulShutdown, TransactionId} @@ -44,8 +44,10 @@ import org.apache.openwhisk.core.service._ import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FlatSpecLike, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import scala.concurrent.Future import scala.concurrent.duration._ @@ -56,7 +58,7 @@ class QueueManagerTests extends TestKit(ActorSystem("QueueManager")) with CommonVariable with ImplicitSender - with FlatSpecLike + with AnyFlatSpecLike with ScalaFutures with Matchers with MockFactory @@ -189,7 +191,7 @@ class QueueManagerTests testQueueManagerActorName) watcher.expectMsg(watchEndpoint) - val testQueueManagerPath = s"akka://QueueManager/user/${testQueueManagerActorName}" + val testQueueManagerPath = s"pekko://QueueManager/user/${testQueueManagerActorName}" val selected = system.actorSelection(testQueueManagerPath) diff --git a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/SchedulingDecisionMakerTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/SchedulingDecisionMakerTests.scala index 386523b1e9d..1eac5fe84ec 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/SchedulingDecisionMakerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/SchedulingDecisionMakerTests.scala @@ -18,23 +18,24 @@ package org.apache.openwhisk.core.scheduler.queue.test import java.util.concurrent.atomic.AtomicInteger -import akka.actor.ActorSystem -import akka.testkit.{TestKit, TestProbe} +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.testkit.{TestKit, TestProbe} import common.StreamLogging import org.apache.openwhisk.core.entity.{EntityName, EntityPath, FullyQualifiedEntityName, SemVer} import org.apache.openwhisk.core.scheduler.SchedulingConfig import org.apache.openwhisk.core.scheduler.queue._ import org.junit.runner.RunWith import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{FlatSpecLike, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import scala.concurrent.duration.DurationInt @RunWith(classOf[JUnitRunner]) class SchedulingDecisionMakerTests extends TestKit(ActorSystem("SchedulingDecisionMakerTests")) - with FlatSpecLike + with AnyFlatSpecLike with ScalaFutures with Matchers with StreamLogging { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/service/DataManagementServiceTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/service/DataManagementServiceTests.scala index 85dc1743152..cb2564e3579 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/service/DataManagementServiceTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/service/DataManagementServiceTests.scala @@ -17,16 +17,18 @@ package org.apache.openwhisk.core.service -import akka.actor.{Actor, ActorRef, ActorRefFactory, ActorSystem, Props} -import akka.testkit.{ImplicitSender, TestActor, TestActorRef, TestKit, TestProbe} -import akka.util.Timeout +import org.apache.pekko.actor.{Actor, ActorRef, ActorRefFactory, ActorSystem, Props} +import org.apache.pekko.testkit.{ImplicitSender, TestActor, TestActorRef, TestKit, TestProbe} +import org.apache.pekko.util.Timeout import common.StreamLogging import org.apache.openwhisk.core.entity.SchedulerInstanceId import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, FlatSpecLike, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import scala.collection.mutable import scala.concurrent.duration._ @@ -37,7 +39,7 @@ import scala.util.Random class DataManagementServiceTests extends TestKit(ActorSystem("DataManagementService")) with ImplicitSender - with FlatSpecLike + with AnyFlatSpecLike with ScalaFutures with Matchers with MockFactory diff --git a/tests/src/test/scala/org/apache/openwhisk/core/service/LeaseKeepAliveServiceTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/service/LeaseKeepAliveServiceTests.scala index 2a7f1b69aec..b4f2f369554 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/service/LeaseKeepAliveServiceTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/service/LeaseKeepAliveServiceTests.scala @@ -17,10 +17,10 @@ package org.apache.openwhisk.core.service -import akka.actor.ActorSystem -import akka.pattern.ask -import akka.testkit.{ImplicitSender, TestFSMRef, TestKit, TestProbe} -import akka.util.Timeout +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.pattern.ask +import org.apache.pekko.testkit.{ImplicitSender, TestFSMRef, TestKit, TestProbe} +import org.apache.pekko.util.Timeout import com.ibm.etcd.api.{LeaseGrantResponse, LeaseKeepAliveResponse, LeaseRevokeResponse, PutResponse} import common.StreamLogging import org.apache.openwhisk.core.WhiskConfig @@ -29,8 +29,10 @@ import org.apache.openwhisk.core.etcd.{EtcdClient, EtcdKV} import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, FlatSpecLike, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import scala.concurrent.duration._ import scala.concurrent.{ExecutionContext, Future} @@ -39,7 +41,7 @@ import scala.concurrent.{ExecutionContext, Future} class LeaseKeepAliveServiceTests extends TestKit(ActorSystem("LeaseKeepAliveService")) with ImplicitSender - with FlatSpecLike + with AnyFlatSpecLike with ScalaFutures with Matchers with MockFactory diff --git a/tests/src/test/scala/org/apache/openwhisk/core/service/WatcherServiceTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/service/WatcherServiceTests.scala index 6c59cfab2ec..bfcbeff429f 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/service/WatcherServiceTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/service/WatcherServiceTests.scala @@ -20,9 +20,9 @@ package org.apache.openwhisk.core.service import java.{lang, util} import java.util.concurrent.Executor -import akka.actor.ActorSystem -import akka.testkit.{ImplicitSender, TestActorRef, TestKit, TestProbe} -import akka.util.Timeout +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.testkit.{ImplicitSender, TestActorRef, TestKit, TestProbe} +import org.apache.pekko.util.Timeout import com.google.protobuf.ByteString import com.ibm.etcd.api.{Event, KeyValue, ResponseHeader} import com.ibm.etcd.api.Event.EventType @@ -35,8 +35,10 @@ import org.apache.openwhisk.core.etcd.EtcdClient import org.junit.runner.RunWith import org.scalamock.scalatest.MockFactory import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, FlatSpecLike, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import scala.concurrent.ExecutionContextExecutor import scala.concurrent.duration._ @@ -45,7 +47,7 @@ import scala.concurrent.duration._ class WatcherServiceTests extends TestKit(ActorSystem("WatcherService")) with ImplicitSender - with FlatSpecLike + with AnyFlatSpecLike with ScalaFutures with Matchers with MockFactory diff --git a/tests/src/test/scala/org/apache/openwhisk/http/PoolingRestClientTests.scala b/tests/src/test/scala/org/apache/openwhisk/http/PoolingRestClientTests.scala index 0afdd62505a..273b226124c 100644 --- a/tests/src/test/scala/org/apache/openwhisk/http/PoolingRestClientTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/http/PoolingRestClientTests.scala @@ -18,18 +18,20 @@ package org.apache.openwhisk.http import org.junit.runner.RunWith -import org.scalatest.{BeforeAndAfterAll, FlatSpecLike, Matchers} +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner -import akka.NotUsed -import akka.actor.ActorSystem -import akka.stream.scaladsl.Flow -import akka.testkit.TestKit -import akka.http.scaladsl.model._ -import akka.http.scaladsl.model.HttpMethods.{GET, POST} -import akka.http.scaladsl.model.StatusCodes.{InternalServerError, NotFound} -import akka.http.scaladsl.model.headers.RawHeader -import akka.http.scaladsl.unmarshalling.Unmarshaller.UnsupportedContentTypeException +import org.scalatestplus.junit.JUnitRunner +import org.apache.pekko.NotUsed +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream.scaladsl.Flow +import org.apache.pekko.testkit.TestKit +import org.apache.pekko.http.scaladsl.model._ +import org.apache.pekko.http.scaladsl.model.HttpMethods.{GET, POST} +import org.apache.pekko.http.scaladsl.model.StatusCodes.{InternalServerError, NotFound} +import org.apache.pekko.http.scaladsl.model.headers.RawHeader +import org.apache.pekko.http.scaladsl.unmarshalling.Unmarshaller.UnsupportedContentTypeException import common.StreamLogging import spray.json.JsObject import spray.json.DefaultJsonProtocol._ @@ -42,7 +44,7 @@ import org.apache.openwhisk.http.PoolingRestClient._ @RunWith(classOf[JUnitRunner]) class PoolingRestClientTests extends TestKit(ActorSystem("PoolingRestClientTests")) - with FlatSpecLike + with AnyFlatSpecLike with Matchers with BeforeAndAfterAll with ScalaFutures diff --git a/tests/src/test/scala/org/apache/openwhisk/spi/SpiTests.scala b/tests/src/test/scala/org/apache/openwhisk/spi/SpiTests.scala index 40425261200..39510780cb3 100644 --- a/tests/src/test/scala/org/apache/openwhisk/spi/SpiTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/spi/SpiTests.scala @@ -21,12 +21,12 @@ import com.typesafe.config.ConfigException import common.StreamLogging import common.WskActorSystem import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -class SpiTests extends FlatSpec with Matchers with WskActorSystem with StreamLogging { +class SpiTests extends AnyFlatSpec with Matchers with WskActorSystem with StreamLogging { behavior of "SpiProvider" diff --git a/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneApiGwTests.scala b/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneApiGwTests.scala index c0da1d336be..e6e00bb57e9 100644 --- a/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneApiGwTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneApiGwTests.scala @@ -22,7 +22,7 @@ import common.{FreePortFinder, WskProps} import org.apache.openwhisk.core.cli.test.ApiGwRestTests import org.apache.openwhisk.utils.retry import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import scala.concurrent.duration._ diff --git a/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneCouchTests.scala b/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneCouchTests.scala index 652c9af6691..2a9a1697b6e 100644 --- a/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneCouchTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneCouchTests.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.standalone import common.WskProps import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import system.basic.WskRestBasicTests @RunWith(classOf[JUnitRunner]) diff --git a/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneKCFTests.scala b/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneKCFTests.scala index 7b8d772d7c9..af6f792838b 100644 --- a/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneKCFTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneKCFTests.scala @@ -24,7 +24,7 @@ import common.WskProps import org.apache.commons.io.FileUtils import org.apache.openwhisk.core.containerpool.kubernetes.test.KubeClientSupport import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import system.basic.WskRestBasicTests @RunWith(classOf[JUnitRunner]) diff --git a/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneKafkaTests.scala b/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneKafkaTests.scala index e3b3829f49c..cf6e9e6a4c8 100644 --- a/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneKafkaTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneKafkaTests.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.standalone import common.WskProps import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import system.basic.WskRestBasicTests @RunWith(classOf[JUnitRunner]) diff --git a/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneServerTests.scala b/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneServerTests.scala index 725033c2a7a..01b9fd806db 100644 --- a/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneServerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneServerTests.scala @@ -19,7 +19,7 @@ package org.apache.openwhisk.standalone import common.WskProps import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import system.basic.WskRestBasicTests @RunWith(classOf[JUnitRunner]) diff --git a/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneUserEventTests.scala b/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneUserEventTests.scala index b89cf5389bc..1aae407b280 100644 --- a/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneUserEventTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/standalone/StandaloneUserEventTests.scala @@ -20,7 +20,7 @@ package org.apache.openwhisk.standalone import common.{FreePortFinder, WskProps} import org.apache.openwhisk.common.UserEventTests import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) class StandaloneUserEventTests extends UserEventTests with StandaloneServerFixture { diff --git a/tests/src/test/scala/org/apache/openwhisk/test/http/RESTProxy.scala b/tests/src/test/scala/org/apache/openwhisk/test/http/RESTProxy.scala index aa56643947d..7c403b582dd 100644 --- a/tests/src/test/scala/org/apache/openwhisk/test/http/RESTProxy.scala +++ b/tests/src/test/scala/org/apache/openwhisk/test/http/RESTProxy.scala @@ -21,15 +21,15 @@ import scala.concurrent.Await import scala.concurrent.duration.DurationInt import scala.concurrent.duration.FiniteDuration -import akka.actor.Actor -import akka.actor.ActorLogging -import akka.http.scaladsl.Http -import akka.http.scaladsl.model._ -import akka.http.scaladsl.model.headers._ -import akka.stream.scaladsl._ -import akka.pattern.ask -import akka.pattern.pipe -import akka.util.Timeout +import org.apache.pekko.actor.Actor +import org.apache.pekko.actor.ActorLogging +import org.apache.pekko.http.scaladsl.Http +import org.apache.pekko.http.scaladsl.model._ +import org.apache.pekko.http.scaladsl.model.headers._ +import org.apache.pekko.stream.scaladsl._ +import org.apache.pekko.pattern.ask +import org.apache.pekko.pattern.pipe +import org.apache.pekko.util.Timeout object RESTProxy { // Orders the proxy to immediately unbind and rebind after the duration has passed. @@ -115,7 +115,7 @@ class RESTProxy(val host: String, val port: Int)(val serviceAuthority: Uri.Autho Http().outgoingConnection(destHost, destPort) } - // akka-http doesn't like us to set those headers ourselves. + // pekko-http doesn't like us to set those headers ourselves. val upstreamRequest = request.withHeaders(headers = request.headers.filter(_ match { case `Timeout-Access`(_) => false case _ => true diff --git a/tests/src/test/scala/org/apache/openwhisk/utils/test/ExecutionContextFactoryTests.scala b/tests/src/test/scala/org/apache/openwhisk/utils/test/ExecutionContextFactoryTests.scala index 545000fdcac..1e107c349d7 100644 --- a/tests/src/test/scala/org/apache/openwhisk/utils/test/ExecutionContextFactoryTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/utils/test/ExecutionContextFactoryTests.scala @@ -22,15 +22,15 @@ import scala.concurrent.Future import scala.concurrent.duration.DurationInt import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import common.WskActorSystem import org.apache.openwhisk.utils.ExecutionContextFactory.FutureExtensions @RunWith(classOf[JUnitRunner]) -class ExecutionContextFactoryTests extends FlatSpec with Matchers with WskActorSystem { +class ExecutionContextFactoryTests extends AnyFlatSpec with Matchers with WskActorSystem { behavior of "future extensions" diff --git a/tests/src/test/scala/services/HeadersTests.scala b/tests/src/test/scala/services/HeadersTests.scala index 6ed49b95ea0..655b7cef286 100644 --- a/tests/src/test/scala/services/HeadersTests.scala +++ b/tests/src/test/scala/services/HeadersTests.scala @@ -22,37 +22,37 @@ import scala.concurrent.duration.DurationInt import scala.language.postfixOps import scala.collection.immutable.Seq import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import org.scalatest.concurrent.ScalaFutures -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import org.scalatest.time.Span.convertDurationToSpan import common.TestUtils import common.WhiskProperties import common.rest.{HttpConnection, WskRestOperations} import common.WskProps import common.WskTestHelpers -import akka.http.scaladsl.model.Uri -import akka.http.scaladsl.model.Uri.Path -import akka.http.scaladsl.model.headers.BasicHttpCredentials -import akka.http.scaladsl.model.HttpRequest -import akka.http.scaladsl.model.StatusCodes.Accepted -import akka.http.scaladsl.model.StatusCodes.OK -import akka.http.scaladsl.model.HttpMethods.DELETE -import akka.http.scaladsl.model.HttpMethods.GET -import akka.http.scaladsl.model.HttpMethods.POST -import akka.http.scaladsl.model.HttpMethods.PUT -import akka.http.scaladsl.model.HttpMethods._ -import akka.http.scaladsl.Http -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.headers._ -import akka.http.scaladsl.model.HttpMethod -import akka.http.scaladsl.model.HttpHeader +import org.apache.pekko.http.scaladsl.model.Uri +import org.apache.pekko.http.scaladsl.model.Uri.Path +import org.apache.pekko.http.scaladsl.model.headers.BasicHttpCredentials +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.http.scaladsl.model.StatusCodes.Accepted +import org.apache.pekko.http.scaladsl.model.StatusCodes.OK +import org.apache.pekko.http.scaladsl.model.HttpMethods.DELETE +import org.apache.pekko.http.scaladsl.model.HttpMethods.GET +import org.apache.pekko.http.scaladsl.model.HttpMethods.POST +import org.apache.pekko.http.scaladsl.model.HttpMethods.PUT +import org.apache.pekko.http.scaladsl.model.HttpMethods._ +import org.apache.pekko.http.scaladsl.Http +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.headers._ +import org.apache.pekko.http.scaladsl.model.HttpMethod +import org.apache.pekko.http.scaladsl.model.HttpHeader import common.WskActorSystem import pureconfig._ @RunWith(classOf[JUnitRunner]) -class HeadersTests extends FlatSpec with Matchers with ScalaFutures with WskActorSystem with WskTestHelpers { +class HeadersTests extends AnyFlatSpec with Matchers with ScalaFutures with WskActorSystem with WskTestHelpers { behavior of "Headers at general API" diff --git a/tests/src/test/scala/services/KafkaConnectorTests.scala b/tests/src/test/scala/services/KafkaConnectorTests.scala index 6064d5672ac..0df872fd00f 100644 --- a/tests/src/test/scala/services/KafkaConnectorTests.scala +++ b/tests/src/test/scala/services/KafkaConnectorTests.scala @@ -25,8 +25,10 @@ import common.{StreamLogging, TestUtils, WhiskProperties, WskActorSystem} import ha.ShootComponentUtils import org.apache.kafka.clients.consumer.CommitFailedException import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.{BeforeAndAfterAll, FlatSpec, Matchers} +import org.scalatestplus.junit.JUnitRunner +import org.scalatest.BeforeAndAfterAll +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import org.apache.openwhisk.common.TransactionId import org.apache.openwhisk.connector.kafka.{KafkaConsumerConnector, KafkaMessagingProvider, KafkaProducerConnector} import org.apache.openwhisk.core.WhiskConfig @@ -40,7 +42,7 @@ import scala.util.Try @RunWith(classOf[JUnitRunner]) class KafkaConnectorTests - extends FlatSpec + extends AnyFlatSpec with Matchers with WskActorSystem with BeforeAndAfterAll diff --git a/tests/src/test/scala/system/basic/WskActionTests.scala b/tests/src/test/scala/system/basic/WskActionTests.scala index a7a5cd89a66..d3609fd92f7 100644 --- a/tests/src/test/scala/system/basic/WskActionTests.scala +++ b/tests/src/test/scala/system/basic/WskActionTests.scala @@ -21,7 +21,7 @@ import java.io.File import java.nio.charset.StandardCharsets import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common._ import common.rest.WskRestOperations import org.apache.openwhisk.core.entity.Annotations diff --git a/tests/src/test/scala/system/basic/WskActivationLogsTests.scala b/tests/src/test/scala/system/basic/WskActivationLogsTests.scala index fb83574668e..a416cf794ea 100644 --- a/tests/src/test/scala/system/basic/WskActivationLogsTests.scala +++ b/tests/src/test/scala/system/basic/WskActivationLogsTests.scala @@ -21,7 +21,7 @@ import common._ import common.rest.WskRestOperations import org.apache.openwhisk.utils.retry import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import scala.concurrent.duration._ diff --git a/tests/src/test/scala/system/basic/WskActivationTests.scala b/tests/src/test/scala/system/basic/WskActivationTests.scala index 5810761495a..59bdcf695f7 100644 --- a/tests/src/test/scala/system/basic/WskActivationTests.scala +++ b/tests/src/test/scala/system/basic/WskActivationTests.scala @@ -19,7 +19,7 @@ package system.basic import common.rest.WskRestOperations import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common._ import spray.json._ diff --git a/tests/src/test/scala/system/basic/WskConductorTests.scala b/tests/src/test/scala/system/basic/WskConductorTests.scala index 7f4406d24c2..a8c766004b1 100644 --- a/tests/src/test/scala/system/basic/WskConductorTests.scala +++ b/tests/src/test/scala/system/basic/WskConductorTests.scala @@ -20,7 +20,7 @@ package system.basic import scala.concurrent.duration.DurationInt import scala.language.postfixOps import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common._ import common.rest.WskRestOperations import spray.json._ diff --git a/tests/src/test/scala/system/basic/WskConsoleTests.scala b/tests/src/test/scala/system/basic/WskConsoleTests.scala index a0c8e35fd69..f60a1971440 100644 --- a/tests/src/test/scala/system/basic/WskConsoleTests.scala +++ b/tests/src/test/scala/system/basic/WskConsoleTests.scala @@ -25,7 +25,7 @@ import scala.concurrent.duration.MILLISECONDS import scala.language.postfixOps import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common.TestHelpers import common.TestUtils diff --git a/tests/src/test/scala/system/basic/WskMultiRuntimeTests.scala b/tests/src/test/scala/system/basic/WskMultiRuntimeTests.scala index 2301f65d08b..2585a96a570 100644 --- a/tests/src/test/scala/system/basic/WskMultiRuntimeTests.scala +++ b/tests/src/test/scala/system/basic/WskMultiRuntimeTests.scala @@ -25,7 +25,7 @@ import common.WskProps import common.WskTestHelpers import common.rest.WskRestOperations import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import spray.json._ import spray.json.DefaultJsonProtocol._ diff --git a/tests/src/test/scala/system/basic/WskPackageTests.scala b/tests/src/test/scala/system/basic/WskPackageTests.scala index 6a78373eae6..92670caa220 100644 --- a/tests/src/test/scala/system/basic/WskPackageTests.scala +++ b/tests/src/test/scala/system/basic/WskPackageTests.scala @@ -23,7 +23,7 @@ import scala.language.postfixOps import scala.collection.mutable.HashMap import scala.concurrent.duration.DurationInt import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common._ import spray.json._ import spray.json.DefaultJsonProtocol.StringJsonFormat diff --git a/tests/src/test/scala/system/basic/WskRestBasicTests.scala b/tests/src/test/scala/system/basic/WskRestBasicTests.scala index 134808928ca..880f698ed3e 100644 --- a/tests/src/test/scala/system/basic/WskRestBasicTests.scala +++ b/tests/src/test/scala/system/basic/WskRestBasicTests.scala @@ -17,16 +17,16 @@ package system.basic -import akka.http.scaladsl.model.StatusCodes.Accepted -import akka.http.scaladsl.model.StatusCodes.BadGateway -import akka.http.scaladsl.model.StatusCodes.Conflict -import akka.http.scaladsl.model.StatusCodes.Unauthorized -import akka.http.scaladsl.model.StatusCodes.NotFound +import org.apache.pekko.http.scaladsl.model.StatusCodes.Accepted +import org.apache.pekko.http.scaladsl.model.StatusCodes.BadGateway +import org.apache.pekko.http.scaladsl.model.StatusCodes.Conflict +import org.apache.pekko.http.scaladsl.model.StatusCodes.Unauthorized +import org.apache.pekko.http.scaladsl.model.StatusCodes.NotFound import java.time.Instant import scala.concurrent.duration.DurationInt import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common._ import common.rest.WskRestOperations import common.rest.RestResult diff --git a/tests/src/test/scala/system/basic/WskRestRuleTests.scala b/tests/src/test/scala/system/basic/WskRestRuleTests.scala index 4cebffb4207..90d0b724d66 100644 --- a/tests/src/test/scala/system/basic/WskRestRuleTests.scala +++ b/tests/src/test/scala/system/basic/WskRestRuleTests.scala @@ -18,7 +18,7 @@ package system.basic import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common.TestUtils.RunResult import common.rest.WskRestOperations diff --git a/tests/src/test/scala/system/basic/WskRuleTests.scala b/tests/src/test/scala/system/basic/WskRuleTests.scala index 77179f7d15e..de004ade46e 100644 --- a/tests/src/test/scala/system/basic/WskRuleTests.scala +++ b/tests/src/test/scala/system/basic/WskRuleTests.scala @@ -18,7 +18,7 @@ package system.basic import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common.TestHelpers import common.TestUtils import common.TestUtils.RunResult diff --git a/tests/src/test/scala/system/basic/WskSequenceTests.scala b/tests/src/test/scala/system/basic/WskSequenceTests.scala index d890176628c..398cdf299c5 100644 --- a/tests/src/test/scala/system/basic/WskSequenceTests.scala +++ b/tests/src/test/scala/system/basic/WskSequenceTests.scala @@ -26,7 +26,7 @@ import scala.concurrent.duration.DurationInt import scala.language.postfixOps import scala.util.matching.Regex import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import common._ import common.TestUtils._ import common.rest.WskRestOperations diff --git a/tests/src/test/scala/system/basic/WskUnicodeTests.scala b/tests/src/test/scala/system/basic/WskUnicodeTests.scala index 67a2a749db2..e8e4ca6a920 100644 --- a/tests/src/test/scala/system/basic/WskUnicodeTests.scala +++ b/tests/src/test/scala/system/basic/WskUnicodeTests.scala @@ -20,7 +20,7 @@ package system.basic import java.io.File import io.restassured.RestAssured import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +import org.scalatestplus.junit.JUnitRunner import scala.concurrent.duration.DurationInt import common._ diff --git a/tests/src/test/scala/system/rest/ActionSchemaTests.scala b/tests/src/test/scala/system/rest/ActionSchemaTests.scala index 4868db4cf02..229bd6c159d 100644 --- a/tests/src/test/scala/system/rest/ActionSchemaTests.scala +++ b/tests/src/test/scala/system/rest/ActionSchemaTests.scala @@ -20,9 +20,9 @@ package system.rest import scala.util.Success import scala.util.Try import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import io.restassured.RestAssured import common._ import common.rest.WskRestOperations @@ -33,7 +33,7 @@ import spray.json._ */ @RunWith(classOf[JUnitRunner]) class ActionSchemaTests - extends FlatSpec + extends AnyFlatSpec with Matchers with RestUtil with JsonSchema diff --git a/tests/src/test/scala/system/rest/GoCLINginxTests.scala b/tests/src/test/scala/system/rest/GoCLINginxTests.scala index df72efe7a88..6504cb4e529 100644 --- a/tests/src/test/scala/system/rest/GoCLINginxTests.scala +++ b/tests/src/test/scala/system/rest/GoCLINginxTests.scala @@ -18,9 +18,9 @@ package system.rest import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import io.restassured.RestAssured @@ -31,7 +31,7 @@ import DefaultJsonProtocol._ * Basic tests of the download link for Go CLI binaries */ @RunWith(classOf[JUnitRunner]) -class GoCLINginxTests extends FlatSpec with Matchers with RestUtil { +class GoCLINginxTests extends AnyFlatSpec with Matchers with RestUtil { val DownloadLinkGoCli = "cli/go/download" val ServiceURL = getServiceURL() diff --git a/tests/src/test/scala/system/rest/JsonSchemaTests.scala b/tests/src/test/scala/system/rest/JsonSchemaTests.scala index 86007af07e1..012b0619fd1 100644 --- a/tests/src/test/scala/system/rest/JsonSchemaTests.scala +++ b/tests/src/test/scala/system/rest/JsonSchemaTests.scala @@ -18,15 +18,15 @@ package system.rest import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner /** * Basic tests of API calls for actions */ @RunWith(classOf[JUnitRunner]) -class JsonSchemaTests extends FlatSpec with Matchers with JsonSchema with RestUtil { +class JsonSchemaTests extends AnyFlatSpec with Matchers with JsonSchema with RestUtil { def TEST_SCHEMA = """{ "type" : "object", diff --git a/tests/src/test/scala/system/rest/RestUtil.scala b/tests/src/test/scala/system/rest/RestUtil.scala index 56c0f3ba161..75f46f49312 100644 --- a/tests/src/test/scala/system/rest/RestUtil.scala +++ b/tests/src/test/scala/system/rest/RestUtil.scala @@ -17,7 +17,7 @@ package system.rest -import akka.http.scaladsl.model.Uri +import org.apache.pekko.http.scaladsl.model.Uri import scala.util.Try import io.restassured.RestAssured diff --git a/tests/src/test/scala/system/rest/SwaggerTests.scala b/tests/src/test/scala/system/rest/SwaggerTests.scala index a0422fe4d07..32994def712 100644 --- a/tests/src/test/scala/system/rest/SwaggerTests.scala +++ b/tests/src/test/scala/system/rest/SwaggerTests.scala @@ -18,9 +18,9 @@ package system.rest import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers -import org.scalatest.junit.JUnitRunner +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.junit.JUnitRunner import io.restassured.RestAssured @@ -30,7 +30,7 @@ import common.WhiskProperties * Basic tests of Swagger support */ @RunWith(classOf[JUnitRunner]) -class SwaggerTests extends FlatSpec with Matchers with RestUtil { +class SwaggerTests extends AnyFlatSpec with Matchers with RestUtil { "Whisk API service" should "respond to /docs with Swagger UI" in { val response = RestAssured.given().config(sslconfig).get(getServiceURL() + "/api/v1/docs/index.html") diff --git a/tools/admin/src/main/scala/org/apache/openwhisk/core/cli/Main.scala b/tools/admin/src/main/scala/org/apache/openwhisk/core/cli/Main.scala index 134b712863b..4a1e3b94afd 100644 --- a/tools/admin/src/main/scala/org/apache/openwhisk/core/cli/Main.scala +++ b/tools/admin/src/main/scala/org/apache/openwhisk/core/cli/Main.scala @@ -19,13 +19,13 @@ package org.apache.openwhisk.core.cli import java.io.File -import akka.actor.ActorSystem -import akka.http.scaladsl.Http +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.Http import ch.qos.logback.classic.{Level, LoggerContext} import org.rogach.scallop._ import org.slf4j.LoggerFactory import pureconfig.error.ConfigReaderException -import org.apache.openwhisk.common.{AkkaLogging, Logging, TransactionId} +import org.apache.openwhisk.common.{Logging, PekkoLogging, TransactionId} import org.apache.openwhisk.core.database.{LimitsCommand, UserCommand} import scala.concurrent.duration.{Duration, DurationInt} @@ -98,7 +98,7 @@ object Main { } private def executeWithSystem(conf: Conf)(implicit actorSystem: ActorSystem): Int = { - implicit val logger = new AkkaLogging(akka.event.Logging.getLogger(actorSystem, this)) + implicit val logger = new PekkoLogging(org.apache.pekko.event.Logging.getLogger(actorSystem, this)) val admin = new WhiskAdmin(conf) val result = Try { diff --git a/tools/admin/src/main/scala/org/apache/openwhisk/core/database/LimitsCommand.scala b/tools/admin/src/main/scala/org/apache/openwhisk/core/database/LimitsCommand.scala index 0b85ca7c10d..2aa166089b4 100644 --- a/tools/admin/src/main/scala/org/apache/openwhisk/core/database/LimitsCommand.scala +++ b/tools/admin/src/main/scala/org/apache/openwhisk/core/database/LimitsCommand.scala @@ -17,7 +17,7 @@ package org.apache.openwhisk.core.database -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.core.cli.{CommandError, CommandMessages, IllegalState, WhiskCommand} import org.apache.openwhisk.core.database.LimitsCommand.LimitEntity diff --git a/tools/admin/src/main/scala/org/apache/openwhisk/core/database/UserCommand.scala b/tools/admin/src/main/scala/org/apache/openwhisk/core/database/UserCommand.scala index bfeee598d1d..4402263edc0 100644 --- a/tools/admin/src/main/scala/org/apache/openwhisk/core/database/UserCommand.scala +++ b/tools/admin/src/main/scala/org/apache/openwhisk/core/database/UserCommand.scala @@ -19,8 +19,8 @@ package org.apache.openwhisk.core.database import java.util.UUID -import akka.actor.ActorSystem -import akka.stream.scaladsl.{Sink, Source} +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream.scaladsl.{Sink, Source} import org.apache.openwhisk.common.{Logging, TransactionId} import org.apache.openwhisk.core.cli.{CommandError, CommandMessages, IllegalState, WhiskCommand} import org.apache.openwhisk.core.database.UserCommand.ExtendedAuth