Skip to content

Commit b735bbe

Browse files
tomerdktoso
andauthored
prepare for oss (#8)
* prepare for oss motivation: setup ci as part of getting ready for oss changes: * adjust docker setup * adjust scripts * some benchmarks can't work on 5.0 because they benchmark 5.2+ features Co-authored-by: Konrad `ktoso` Malawski <[email protected]>
1 parent 0eb2da5 commit b735bbe

12 files changed

+161
-6
lines changed

Package.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ let package = Package(
99
.library(name: "TracingOpenTelemetrySupport", targets: ["TracingOpenTelemetrySupport"]),
1010
],
1111
dependencies: [
12-
.package(url: "https://github.com/apple/swift-distributed-tracing-baggage.git", from: "0.0.1"),
12+
// FIXME: changes to https when public
13+
.package(url: "[email protected]:apple/swift-distributed-tracing-baggage.git", from: "0.0.1"),
1314
],
1415
targets: [
1516
// ==== --------------------------------------------------------------------------------------------------------

Sources/_TracingBenchmarks/SpanAttributesDSLBenchmark.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14+
#if swift(>=5.2)
15+
1416
import _TracingBenchmarkTools
1517
import Tracing
1618
import TracingOpenTelemetrySupport
@@ -130,3 +132,5 @@ func bench_set_Int_dsl(times: Int) throws {
130132
span.attributes.http.statusCode = 200
131133
}
132134
}
135+
136+
#endif

Sources/_TracingBenchmarks/main.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ private func registerBenchmark(_ name: String, _ function: @escaping (Int) -> Vo
3636
registerBenchmark(BenchmarkInfo(name: name, runFunction: function, tags: tags))
3737
}
3838

39+
#if swift(>=5.2)
3940
registerBenchmark(SpanAttributesDSLBenchmarks)
41+
#endif
4042

4143
main()

dev/Dockerfile-5.0.3

Lines changed: 0 additions & 3 deletions
This file was deleted.

dev/Dockerfile-5.1

Lines changed: 0 additions & 1 deletion
This file was deleted.

dev/Dockerfile-5.2

Lines changed: 0 additions & 1 deletion
This file was deleted.

docker/Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
ARG swift_version=5.0
2+
ARG ubuntu_version=bionic
3+
ARG base_image=swift:$swift_version-$ubuntu_version
4+
FROM $base_image
5+
# needed to do again after FROM due to docker limitation
6+
ARG swift_version
7+
ARG ubuntu_version
8+
9+
# set as UTF-8
10+
RUN apt-get update && apt-get install -y locales locales-all
11+
ENV LC_ALL en_US.UTF-8
12+
ENV LANG en_US.UTF-8
13+
ENV LANGUAGE en_US.UTF-8
14+
15+
# dependencies
16+
RUN apt-get update && apt-get install -y wget
17+
RUN apt-get update && apt-get install -y lsof dnsutils netcat-openbsd net-tools curl jq # used by integration tests
18+
19+
# ruby and jazzy for docs generation
20+
RUN apt-get update && apt-get install -y ruby ruby-dev libsqlite3-dev
21+
RUN gem install jazzy --no-ri --no-rdoc
22+
23+
# tools
24+
RUN mkdir -p $HOME/.tools
25+
RUN echo 'export PATH="$HOME/.tools:$PATH"' >> $HOME/.profile
26+
27+
# swiftformat (until part of the toolchain)
28+
29+
ARG swiftformat_version=0.44.6
30+
RUN git clone --branch $swiftformat_version --depth 1 https://github.com/nicklockwood/SwiftFormat $HOME/.tools/swift-format
31+
RUN cd $HOME/.tools/swift-format && swift build -c release
32+
RUN ln -s $HOME/.tools/swift-format/.build/release/swiftformat $HOME/.tools/swiftformat

docker/docker-compose.1804.50.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: "3"
2+
3+
services:
4+
5+
runtime-setup:
6+
image: swift-distributed-tracing:18.04-5.0
7+
build:
8+
args:
9+
ubuntu_version: "bionic"
10+
swift_version: "5.0"
11+
12+
test:
13+
image: swift-distributed-tracing:18.04-5.0
14+
15+
shell:
16+
image: swift-distributed-tracing:18.04-5.0

docker/docker-compose.1804.51.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: "3"
2+
3+
services:
4+
5+
runtime-setup:
6+
image: swift-distributed-tracing:18.04-5.1
7+
build:
8+
args:
9+
ubuntu_version: "bionic"
10+
swift_version: "5.1"
11+
12+
test:
13+
image: swift-distributed-tracing:18.04-5.1
14+
environment: []
15+
#- SANITIZER_ARG=--sanitize=thread
16+
17+
shell:
18+
image: swift-distributed-tracing:18.04-5.1

docker/docker-compose.1804.52.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: "3"
2+
3+
services:
4+
5+
runtime-setup:
6+
image: swift-distributed-tracing:18.04-5.2
7+
build:
8+
args:
9+
ubuntu_version: "bionic"
10+
swift_version: "5.2"
11+
12+
test:
13+
image: swift-distributed-tracing:18.04-5.2
14+
environment: []
15+
#- SANITIZER_ARG=--sanitize=thread
16+
17+
shell:
18+
image: swift-distributed-tracing:18.04-5.2

0 commit comments

Comments
 (0)