Эх сурвалжийг харах

Swift 5.7 and Hummingbird v1.0 (#7941)

* Use Hummingbird 1.0

* HB Swift 5.7

* gitignore for swift-nio

* Vapor swift:5.7

* Update READMEs

* Fix hummingbird postgres

* Add gitignore to vapor

* Fix vapor-mongo-fluent Package.swift

* Remove Package.resolved

* Resurrect orlandos-nl/MongoKitten.git

* Temporarily remove mongo-fluent
Adam Fowler 2 жил өмнө
parent
commit
09260478c9

+ 1 - 1
frameworks/Swift/hummingbird-core/README.md

@@ -9,7 +9,7 @@ Hummingbird Core is the HTTP server for the Hummingbird framework.
 
 ## Important Libraries
 This version of Hummingbird requires
-* [Swift 5.3](https://swift.org)  
+* [Swift 5.7](https://swift.org)  
 * [SwiftNIO 2.x](https://github.com/apple/swift-nio/)
 
 ## Test URLs

+ 2 - 2
frameworks/Swift/hummingbird-core/hummingbird-core.dockerfile

@@ -1,7 +1,7 @@
 # ================================
 # Build image
 # ================================
-FROM swift:5.6-focal as build
+FROM swift:5.7 as build
 WORKDIR /build
 
 # Copy entire repo into container
@@ -15,7 +15,7 @@ RUN swift build \
 # ================================
 # Run image
 # ================================
-FROM swift:5.6-focal-slim
+FROM swift:5.7-slim
 WORKDIR /run
 
 # Copy build artifacts

+ 1 - 1
frameworks/Swift/hummingbird-core/src/Package.swift

@@ -9,7 +9,7 @@ let package = Package(
         .executable(name: "server", targets: ["server"])
     ],
     dependencies: [
-        .package(url: "https://github.com/hummingbird-project/hummingbird-core.git", .upToNextMinor(from: "0.12.1")),
+        .package(url: "https://github.com/hummingbird-project/hummingbird-core.git", from: "1.0.0"),
     ],
     targets: [
         .target(name: "server",

+ 1 - 1
frameworks/Swift/hummingbird/README.md

@@ -13,7 +13,7 @@ Hummingbird is a lightweight, flexible HTTP server framework written in Swift.
 
 ## Important Libraries
 This version of Hummingbird requires
-* [Swift 5.3](https://swift.org)  
+* [Swift 5.7](https://swift.org)  
 * [SwiftNIO 2.x](https://github.com/apple/swift-nio/)
 In these tests for database access it uses
 * [PostgresKit 2.0](https://github.com/vapor/postgres-kit/)

+ 2 - 2
frameworks/Swift/hummingbird/hummingbird-postgres.dockerfile

@@ -1,7 +1,7 @@
 # ================================
 # Build image
 # ================================
-FROM swift:5.6-focal as build
+FROM swift:5.7 as build
 WORKDIR /build
 
 # Copy entire repo into container
@@ -15,7 +15,7 @@ RUN swift build \
 # ================================
 # Run image
 # ================================
-FROM swift:5.6-focal-slim
+FROM swift:5.7-slim
 WORKDIR /run
 
 # Copy build artifacts

+ 2 - 2
frameworks/Swift/hummingbird/hummingbird.dockerfile

@@ -1,7 +1,7 @@
 # ================================
 # Build image
 # ================================
-FROM swift:5.6-focal as build
+FROM swift:5.7 as build
 WORKDIR /build
 
 # Copy entire repo into container
@@ -15,7 +15,7 @@ RUN swift build \
 # ================================
 # Run image
 # ================================
-FROM swift:5.6-focal-slim
+FROM swift:5.7-slim
 WORKDIR /run
 
 # Copy build artifacts

+ 1 - 1
frameworks/Swift/hummingbird/src-postgres/Package.swift

@@ -10,7 +10,7 @@ let package = Package(
         .executable(name: "server", targets: ["server"])
     ],
     dependencies: [
-        .package(url: "https://github.com/hummingbird-project/hummingbird.git", .upToNextMinor(from: "0.16.0")),
+        .package(url: "https://github.com/hummingbird-project/hummingbird.git", from: "1.0.0"),
         .package(url: "https://github.com/hummingbird-project/hummingbird-mustache.git", from: "1.0.1"),
         .package(url: "https://github.com/vapor/postgres-nio.git", from: "1.8.0"),
     ],

+ 1 - 1
frameworks/Swift/hummingbird/src-postgres/Sources/server/Controllers/FortunesController.swift

@@ -21,7 +21,7 @@ class FortunesController {
         """)
     }
 
-    func add(to router: HBRouter) {
+    func add(to router: HBRouterBuilder) {
         router.get("fortunes", use: fortunes)
     }
 

+ 1 - 1
frameworks/Swift/hummingbird/src-postgres/Sources/server/Controllers/WorldController.swift

@@ -4,7 +4,7 @@ import PostgresNIO
 struct WorldController {
     let connectionPoolGroup: HBConnectionPoolGroup<PostgresConnectionSource>
 
-    func add(to router: HBRouter) {
+    func add(to router: HBRouterBuilder) {
         router.get("db", use: single)
         router.get("queries", use: multiple)
         router.get("updates", use: updates)

+ 1 - 1
frameworks/Swift/hummingbird/src/Package.swift

@@ -9,7 +9,7 @@ let package = Package(
         .executable(name: "server", targets: ["server"])
     ],
     dependencies: [
-        .package(url: "https://github.com/hummingbird-project/hummingbird.git", .upToNextMinor(from: "0.13.1")),
+        .package(url: "https://github.com/hummingbird-project/hummingbird.git", from: "1.0.0"),
     ],
     targets: [
         .target(name: "server",

+ 8 - 0
frameworks/Swift/swift-nio/.gitignore

@@ -0,0 +1,8 @@
+.DS_Store
+.build/
+.vscode/
+/*.xcodeproj
+xcuserdata/
+.swiftpm/
+DerivedData/
+Package.resolved

+ 7 - 0
frameworks/Swift/vapor/.gitignore

@@ -0,0 +1,7 @@
+.DS_Store
+.build/
+/*.xcodeproj
+xcuserdata/
+.swiftpm/
+DerivedData/
+Package.resolved

+ 1 - 1
frameworks/Swift/vapor/README.md

@@ -12,7 +12,7 @@ PostgreSQL
 
 ## Versions
 
-[Swift 5.5](https://swift.org/)
+[Swift 5.7](https://swift.org/)
 [Vapor 4](https://vapor.codes/)
 
 ## Test URLs: `vapor`

+ 0 - 19
frameworks/Swift/vapor/benchmark_config.json

@@ -76,25 +76,6 @@
       "notes": "",
       "versus": "None"
     },
-    "mongo-fluent": {
-      "db_url": "/db",
-      "query_url": "/queries?queries=",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Fullstack",
-      "database": "MongoDb",
-      "framework": "Vapor",
-      "language": "Swift",
-      "flavor": "None",
-      "orm": "Full",
-      "platform": "None",
-      "webserver": "None",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "Vapor",
-      "notes": "",
-      "versus": "None"
-    },
     "mongo": {
       "db_url": "/db",
       "port": 8080,

+ 2 - 2
frameworks/Swift/vapor/vapor-fluent.dockerfile

@@ -1,7 +1,7 @@
 # ================================
 # Build image
 # ================================
-FROM swift:5.6-focal as build
+FROM swift:5.7 as build
 WORKDIR /build
 
 # Copy entire repo into container
@@ -15,7 +15,7 @@ RUN swift build \
 # ================================
 # Run image
 # ================================
-FROM swift:5.6-focal-slim
+FROM swift:5.7-slim
 WORKDIR /run
 
 # Copy build artifacts

+ 2 - 2
frameworks/Swift/vapor/vapor-mongo-fluent.dockerfile

@@ -1,7 +1,7 @@
 # ================================
 # Build image
 # ================================
-FROM swift:5.6-focal as build
+FROM swift:5.7 as build
 WORKDIR /build
 
 # Copy entire repo into container
@@ -15,7 +15,7 @@ RUN swift build \
 # ================================
 # Run image
 # ================================
-FROM swift:5.6-focal-slim
+FROM swift:5.7-slim
 WORKDIR /run
 
 # Copy build artifacts

+ 0 - 214
frameworks/Swift/vapor/vapor-mongo-fluent/Package.resolved

@@ -1,214 +0,0 @@
-{
-  "object": {
-    "pins": [
-      {
-        "package": "async-http-client",
-        "repositoryURL": "https://github.com/swift-server/async-http-client.git",
-        "state": {
-          "branch": null,
-          "revision": "170fd536f931c0bffb58f37a53fc238e77f42258",
-          "version": "1.6.4"
-        }
-      },
-      {
-        "package": "async-kit",
-        "repositoryURL": "https://github.com/vapor/async-kit.git",
-        "state": {
-          "branch": null,
-          "revision": "748c026f4dc93c0b9d05fe43a07d3922ca126744",
-          "version": "1.10.0"
-        }
-      },
-      {
-        "package": "BSON",
-        "repositoryURL": "https://github.com/OpenKitten/BSON.git",
-        "state": {
-          "branch": null,
-          "revision": "98a2c90988895f1b985ed0066180995df995924c",
-          "version": "7.0.28"
-        }
-      },
-      {
-        "package": "console-kit",
-        "repositoryURL": "https://github.com/vapor/console-kit.git",
-        "state": {
-          "branch": null,
-          "revision": "75ea3b627d88221440b878e5dfccc73fd06842ed",
-          "version": "4.2.7"
-        }
-      },
-      {
-        "package": "fluent",
-        "repositoryURL": "https://github.com/vapor/fluent.git",
-        "state": {
-          "branch": null,
-          "revision": "ea707ee318066a073c95b2b2df1aa640fcb67f9e",
-          "version": "4.4.0"
-        }
-      },
-      {
-        "package": "fluent-kit",
-        "repositoryURL": "https://github.com/vapor/fluent-kit.git",
-        "state": {
-          "branch": null,
-          "revision": "9fbef6bad614e0b1bf3083f629b40574c97ab0b9",
-          "version": "1.16.0"
-        }
-      },
-      {
-        "package": "fluent-mongo-driver",
-        "repositoryURL": "https://github.com/vapor/fluent-mongo-driver.git",
-        "state": {
-          "branch": null,
-          "revision": "ce519013f51439773fe668d6575888665b0e2dda",
-          "version": "1.0.2"
-        }
-      },
-      {
-        "package": "MongoKitten",
-        "repositoryURL": "https://github.com/orlandos-nl/MongoKitten.git",
-        "state": {
-          "branch": null,
-          "revision": "311b793a4d3d3462ea4c569acbcd5366d1528dc8",
-          "version": "6.7.1"
-        }
-      },
-      {
-        "package": "multipart-kit",
-        "repositoryURL": "https://github.com/vapor/multipart-kit.git",
-        "state": {
-          "branch": null,
-          "revision": "2dd9368a3c9580792b77c7ef364f3735909d9996",
-          "version": "4.5.1"
-        }
-      },
-      {
-        "package": "DNSClient",
-        "repositoryURL": "https://github.com/OpenKitten/NioDNS.git",
-        "state": {
-          "branch": null,
-          "revision": "7517b774d48833f04869fcde668d2f338fadc464",
-          "version": "2.0.6"
-        }
-      },
-      {
-        "package": "routing-kit",
-        "repositoryURL": "https://github.com/vapor/routing-kit.git",
-        "state": {
-          "branch": null,
-          "revision": "a0801a36a6ad501d5ad6285cbcd4774de6b0a734",
-          "version": "4.3.0"
-        }
-      },
-      {
-        "package": "sql-kit",
-        "repositoryURL": "https://github.com/vapor/sql-kit.git",
-        "state": {
-          "branch": null,
-          "revision": "8587674e7e2499fd2017840973f416182025b02d",
-          "version": "3.12.1"
-        }
-      },
-      {
-        "package": "swift-backtrace",
-        "repositoryURL": "https://github.com/swift-server/swift-backtrace.git",
-        "state": {
-          "branch": null,
-          "revision": "d3e04a9d4b3833363fb6192065b763310b156d54",
-          "version": "1.3.1"
-        }
-      },
-      {
-        "package": "swift-crypto",
-        "repositoryURL": "https://github.com/apple/swift-crypto.git",
-        "state": {
-          "branch": null,
-          "revision": "9b5ef28601a9c745c9cdb54d3f243e28ac830982",
-          "version": "2.0.1"
-        }
-      },
-      {
-        "package": "swift-log",
-        "repositoryURL": "https://github.com/apple/swift-log.git",
-        "state": {
-          "branch": null,
-          "revision": "5d66f7ba25daf4f94100e7022febf3c75e37a6c7",
-          "version": "1.4.2"
-        }
-      },
-      {
-        "package": "swift-metrics",
-        "repositoryURL": "https://github.com/apple/swift-metrics.git",
-        "state": {
-          "branch": null,
-          "revision": "3edd2f57afc4e68e23c3e4956bc8b65ca6b5b2ff",
-          "version": "2.2.0"
-        }
-      },
-      {
-        "package": "swift-nio",
-        "repositoryURL": "https://github.com/apple/swift-nio.git",
-        "state": {
-          "branch": null,
-          "revision": "addf69cfe60376c325397c8926589415576b1dd1",
-          "version": "2.34.0"
-        }
-      },
-      {
-        "package": "swift-nio-extras",
-        "repositoryURL": "https://github.com/apple/swift-nio-extras.git",
-        "state": {
-          "branch": null,
-          "revision": "f73ca5ee9c6806800243f1ac415fcf82de9a4c91",
-          "version": "1.10.2"
-        }
-      },
-      {
-        "package": "swift-nio-http2",
-        "repositoryURL": "https://github.com/apple/swift-nio-http2.git",
-        "state": {
-          "branch": null,
-          "revision": "326f7f9a8c8c8402e3691adac04911cac9f9d87f",
-          "version": "1.18.4"
-        }
-      },
-      {
-        "package": "swift-nio-ssl",
-        "repositoryURL": "https://github.com/apple/swift-nio-ssl.git",
-        "state": {
-          "branch": null,
-          "revision": "36f6419f2b1b6490a8c0faa840298e28027cefe9",
-          "version": "2.16.3"
-        }
-      },
-      {
-        "package": "swift-nio-transport-services",
-        "repositoryURL": "https://github.com/apple/swift-nio-transport-services.git",
-        "state": {
-          "branch": null,
-          "revision": "e7f5278a26442dc46783ba7e063643d524e414a0",
-          "version": "1.11.3"
-        }
-      },
-      {
-        "package": "vapor",
-        "repositoryURL": "https://github.com/vapor/vapor.git",
-        "state": {
-          "branch": null,
-          "revision": "80750314e0d9ae11b3886df7f43f495b0661d2dc",
-          "version": "4.52.2"
-        }
-      },
-      {
-        "package": "websocket-kit",
-        "repositoryURL": "https://github.com/vapor/websocket-kit.git",
-        "state": {
-          "branch": null,
-          "revision": "b1c4df8f6c848c2e977726903bbe6578eed723ad",
-          "version": "2.2.0"
-        }
-      }
-    ]
-  },
-  "version": 1
-}

+ 2 - 2
frameworks/Swift/vapor/vapor-mongo.dockerfile

@@ -1,7 +1,7 @@
 # ================================
 # Build image
 # ================================
-FROM swift:5.6-focal as build
+FROM swift:5.7 as build
 WORKDIR /build
 
 # Copy entire repo into container
@@ -18,7 +18,7 @@ RUN swift build \
 # ================================
 # Run image
 # ================================
-FROM swift:5.6-focal-slim
+FROM swift:5.7-slim
 WORKDIR /run
 
 RUN apt update

+ 0 - 196
frameworks/Swift/vapor/vapor-mongo/Package.resolved

@@ -1,196 +0,0 @@
-{
-  "object": {
-    "pins": [
-      {
-        "package": "async-http-client",
-        "repositoryURL": "https://github.com/swift-server/async-http-client.git",
-        "state": {
-          "branch": null,
-          "revision": "170fd536f931c0bffb58f37a53fc238e77f42258",
-          "version": "1.6.4"
-        }
-      },
-      {
-        "package": "async-kit",
-        "repositoryURL": "https://github.com/vapor/async-kit.git",
-        "state": {
-          "branch": null,
-          "revision": "748c026f4dc93c0b9d05fe43a07d3922ca126744",
-          "version": "1.10.0"
-        }
-      },
-      {
-        "package": "console-kit",
-        "repositoryURL": "https://github.com/vapor/console-kit.git",
-        "state": {
-          "branch": null,
-          "revision": "75ea3b627d88221440b878e5dfccc73fd06842ed",
-          "version": "4.2.7"
-        }
-      },
-      {
-        "package": "mongo-swift-driver",
-        "repositoryURL": "https://github.com/mongodb/mongo-swift-driver",
-        "state": {
-          "branch": null,
-          "revision": "bc61d4a743519babd9e93acbbc9404d8eb92f61b",
-          "version": "1.2.0"
-        }
-      },
-      {
-        "package": "mongodb-vapor",
-        "repositoryURL": "https://github.com/mongodb/mongodb-vapor",
-        "state": {
-          "branch": null,
-          "revision": "046a7e00332a83a5eec01d9237179ba0f4ef912a",
-          "version": "1.0.0"
-        }
-      },
-      {
-        "package": "multipart-kit",
-        "repositoryURL": "https://github.com/vapor/multipart-kit.git",
-        "state": {
-          "branch": null,
-          "revision": "2dd9368a3c9580792b77c7ef364f3735909d9996",
-          "version": "4.5.1"
-        }
-      },
-      {
-        "package": "Nimble",
-        "repositoryURL": "https://github.com/Quick/Nimble.git",
-        "state": {
-          "branch": null,
-          "revision": "7a46a5fc86cb917f69e3daf79fcb045283d8f008",
-          "version": "8.1.2"
-        }
-      },
-      {
-        "package": "routing-kit",
-        "repositoryURL": "https://github.com/vapor/routing-kit.git",
-        "state": {
-          "branch": null,
-          "revision": "a0801a36a6ad501d5ad6285cbcd4774de6b0a734",
-          "version": "4.3.0"
-        }
-      },
-      {
-        "package": "swift-backtrace",
-        "repositoryURL": "https://github.com/swift-server/swift-backtrace.git",
-        "state": {
-          "branch": null,
-          "revision": "d3e04a9d4b3833363fb6192065b763310b156d54",
-          "version": "1.3.1"
-        }
-      },
-      {
-        "package": "swift-bson",
-        "repositoryURL": "https://github.com/mongodb/swift-bson",
-        "state": {
-          "branch": null,
-          "revision": "711690b4703ca9f3891591c1012b462aedefef14",
-          "version": "3.0.2"
-        }
-      },
-      {
-        "package": "swift-crypto",
-        "repositoryURL": "https://github.com/apple/swift-crypto.git",
-        "state": {
-          "branch": null,
-          "revision": "9b5ef28601a9c745c9cdb54d3f243e28ac830982",
-          "version": "2.0.1"
-        }
-      },
-      {
-        "package": "swift-extras-base64",
-        "repositoryURL": "https://github.com/swift-extras/swift-extras-base64",
-        "state": {
-          "branch": null,
-          "revision": "778e00dd7cc2b7970742f061cffc87dd570e6bfa",
-          "version": "0.5.0"
-        }
-      },
-      {
-        "package": "swift-extras-json",
-        "repositoryURL": "https://github.com/swift-extras/swift-extras-json",
-        "state": {
-          "branch": null,
-          "revision": "122b9454ef01bf89a4c190b8fd3717ddd0a2fbd0",
-          "version": "0.6.0"
-        }
-      },
-      {
-        "package": "swift-log",
-        "repositoryURL": "https://github.com/apple/swift-log.git",
-        "state": {
-          "branch": null,
-          "revision": "5d66f7ba25daf4f94100e7022febf3c75e37a6c7",
-          "version": "1.4.2"
-        }
-      },
-      {
-        "package": "swift-metrics",
-        "repositoryURL": "https://github.com/apple/swift-metrics.git",
-        "state": {
-          "branch": null,
-          "revision": "3edd2f57afc4e68e23c3e4956bc8b65ca6b5b2ff",
-          "version": "2.2.0"
-        }
-      },
-      {
-        "package": "swift-nio-extras",
-        "repositoryURL": "https://github.com/apple/swift-nio-extras.git",
-        "state": {
-          "branch": null,
-          "revision": "f73ca5ee9c6806800243f1ac415fcf82de9a4c91",
-          "version": "1.10.2"
-        }
-      },
-      {
-        "package": "swift-nio-http2",
-        "repositoryURL": "https://github.com/apple/swift-nio-http2.git",
-        "state": {
-          "branch": null,
-          "revision": "326f7f9a8c8c8402e3691adac04911cac9f9d87f",
-          "version": "1.18.4"
-        }
-      },
-      {
-        "package": "swift-nio-ssl",
-        "repositoryURL": "https://github.com/apple/swift-nio-ssl.git",
-        "state": {
-          "branch": null,
-          "revision": "36f6419f2b1b6490a8c0faa840298e28027cefe9",
-          "version": "2.16.3"
-        }
-      },
-      {
-        "package": "swift-nio-transport-services",
-        "repositoryURL": "https://github.com/apple/swift-nio-transport-services.git",
-        "state": {
-          "branch": null,
-          "revision": "e7f5278a26442dc46783ba7e063643d524e414a0",
-          "version": "1.11.3"
-        }
-      },
-      {
-        "package": "vapor",
-        "repositoryURL": "https://github.com/vapor/vapor.git",
-        "state": {
-          "branch": null,
-          "revision": "80750314e0d9ae11b3886df7f43f495b0661d2dc",
-          "version": "4.52.2"
-        }
-      },
-      {
-        "package": "websocket-kit",
-        "repositoryURL": "https://github.com/vapor/websocket-kit.git",
-        "state": {
-          "branch": null,
-          "revision": "b1c4df8f6c848c2e977726903bbe6578eed723ad",
-          "version": "2.2.0"
-        }
-      }
-    ]
-  },
-  "version": 1
-}

+ 2 - 2
frameworks/Swift/vapor/vapor-postgres.dockerfile

@@ -1,7 +1,7 @@
 # ================================
 # Build image
 # ================================
-FROM swift:5.6-focal as build
+FROM swift:5.7 as build
 WORKDIR /build
 
 # Copy entire repo into container
@@ -15,7 +15,7 @@ RUN swift build \
 # ================================
 # Run image
 # ================================
-FROM swift:5.6-focal-slim
+FROM swift:5.7-slim
 WORKDIR /run
 
 # Copy build artifacts

+ 2 - 2
frameworks/Swift/vapor/vapor-sql-kit.dockerfile

@@ -1,7 +1,7 @@
 # ================================
 # Build image
 # ================================
-FROM swift:5.6-focal as build
+FROM swift:5.7 as build
 WORKDIR /build
 
 # Copy entire repo into container
@@ -15,7 +15,7 @@ RUN swift build \
 # ================================
 # Run image
 # ================================
-FROM swift:5.6-focal-slim
+FROM swift:5.7-slim
 WORKDIR /run
 
 # Copy build artifacts

+ 2 - 2
frameworks/Swift/vapor/vapor.dockerfile

@@ -1,7 +1,7 @@
 # ================================
 # Build image
 # ================================
-FROM swift:5.6-focal as build
+FROM swift:5.7 as build
 WORKDIR /build
 
 # Copy entire repo into container
@@ -15,7 +15,7 @@ RUN swift build \
 # ================================
 # Run image
 # ================================
-FROM swift:5.6-focal-slim
+FROM swift:5.7-slim
 WORKDIR /run
 
 # Copy build artifacts