From fbd612e6954f08ec907338588c3369171ba1d97b Mon Sep 17 00:00:00 2001 From: Patrick Freed Date: Fri, 14 Feb 2020 13:49:35 -0500 Subject: [PATCH 1/2] remove libmongoc installation from examples and readme --- Examples/Docker/Dockerfile | 14 ------- Examples/Docker/Dockerfile.vapor | 65 -------------------------------- Examples/Docker/README.md | 34 ----------------- README.md | 13 ++----- 4 files changed, 3 insertions(+), 123 deletions(-) delete mode 100644 Examples/Docker/Dockerfile delete mode 100644 Examples/Docker/Dockerfile.vapor delete mode 100644 Examples/Docker/README.md diff --git a/Examples/Docker/Dockerfile b/Examples/Docker/Dockerfile deleted file mode 100644 index 20b2a5c5c..000000000 --- a/Examples/Docker/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM ubuntu:16.04 - -# Getting the tools needed for building from source -RUN apt-get -qq update && apt-get install -y \ - git cmake libssl-dev libsasl2-dev \ - && rm -r /var/lib/apt/lists/* - -# Compiling latest libmongoc and libbson -RUN git clone -b r1.13 https://github.com/mongodb/mongo-c-driver /tmp/libmongoc -WORKDIR /tmp/libmongoc -RUN cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -RUN make -j8 install - -WORKDIR /app \ No newline at end of file diff --git a/Examples/Docker/Dockerfile.vapor b/Examples/Docker/Dockerfile.vapor deleted file mode 100644 index f64f4b173..000000000 --- a/Examples/Docker/Dockerfile.vapor +++ /dev/null @@ -1,65 +0,0 @@ -# --------------------------------------------------------------------------- -# Builder container -# --------------------------------------------------------------------------- - -# You can set the Swift version to what you need for your app. -# Versions can be found here: https://hub.docker.com/_/swift -FROM swift:4.2 as builder - -# For local build, add `--build-arg env=docker` -# In your application, you can use `Environment.custom(name: "docker")` to check if you're in this env -# ARG env - -RUN apt-get -qq update && apt-get -q -y install \ - tzdata \ - git cmake libssl-dev libsasl2-dev \ - && rm -r /var/lib/apt/lists/* - -# Compiling latest libmongoc and libbson -RUN git clone -b r1.13 https://github.com/mongodb/mongo-c-driver /tmp/libmongoc -WORKDIR /tmp/libmongoc -RUN cmake \ - -DCMAKE_INSTALL_PREFIX:PATH=/usr \ - -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF \ - -DCMAKE_BUILD_TYPE=Release -RUN make -j8 install - -WORKDIR /app -COPY . . -RUN mkdir -p /build/lib && cp -R /usr/lib/swift/linux/*.so /build/lib -RUN swift build -c release && mv `swift build -c release --show-bin-path` /build/bin - -# --------------------------------------------------------------------------- -# Production image -# --------------------------------------------------------------------------- - -FROM ubuntu:16.04 - -RUN apt-get -qq update && apt-get install -y \ - libicu55 libxml2 libbsd0 libcurl3 libatomic1 \ - tzdata \ - git cmake libssl-dev libsasl2-dev \ - && rm -r /var/lib/apt/lists/* - -# Compiling latest libmongoc and libbson -RUN git clone -b r1.13 https://github.com/mongodb/mongo-c-driver /tmp/libmongoc -WORKDIR /tmp/libmongoc -RUN cmake \ - -DCMAKE_INSTALL_PREFIX:PATH=/usr \ - -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF \ - -DCMAKE_BUILD_TYPE=Release -RUN make -j8 install - -WORKDIR /app -COPY .env.development .env -COPY --from=builder /build/bin/Run . -COPY --from=builder /build/lib/* /usr/lib/ - -# Uncomment the next line if you need to load resources from the `Public` directory -#COPY --from=builder /app/Public ./Public -# Uncommand the next line if you are using Leaf -#COPY --from=builder /app/Resources ./Resources -# ENV ENVIRONMENT=$env - -EXPOSE 8080 -ENTRYPOINT ./Run serve --env production --hostname 0.0.0.0 --port 8080 \ No newline at end of file diff --git a/Examples/Docker/README.md b/Examples/Docker/README.md deleted file mode 100644 index 9a14a43d2..000000000 --- a/Examples/Docker/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# Building `libmongoc` From Source With Docker - -For the `mongo-swift-driver` to run, **the minimum required version of the -C Driver is 1.15.3**. The easiest way to get the correct version -of `libmongoc` and `libbson` is to checkout the correct -[branch](https://github.com/mongodb/mongo-c-driver/tree/r1.15) from git and -build the sources. - -## Dependencies - -* Ubuntu 16.04 / 18.04 -* git -* cmake -* libssl-dev -* libsasl2-dev - -## Build - -```Dockerfile -RUN git clone -b r1.15 https://github.com/mongodb/mongo-c-driver /tmp/libmongoc -WORKDIR /tmp/libmongoc -RUN cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -RUN make -j8 install -``` - -Further useful `cmake` prefixes are: - -- `-DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF` see [reference here](http://mongoc.org/libmongoc/current/init-cleanup.html). -- `-DCMAKE_BUILD_TYPE=Release` to build a release optimized build. - -## Vapor - -When building and running Vapor in Docker, the C Driver is needed in both the -builder and runner containers. See `Dockerfile.vapor` for an example. diff --git a/README.md b/README.md index 2dae23d7b..b2a249daf 100644 --- a/README.md +++ b/README.md @@ -37,19 +37,12 @@ Core Server (i.e. SERVER) project are **public**. Installation is supported via [Swift Package Manager](https://swift.org/package-manager/). -### Step 1: Install the MongoDB C Driver -The driver wraps the MongoDB C driver, and using it requires having the C driver's two components, `libbson` and `libmongoc`, installed on your system. **The minimum required version of the C Driver is 1.15.3**. +### Step 1: Install required system libraries (Linux Only) +The driver vendors and wraps the MongoDB C driver (`libmongoc`), which depends on a number of external C libraries when built in Linux environments. As a result, these libraries must be installed on your system in order to build MongoSwift. -*On a Mac*, you can install both components at once using [Homebrew](https://brew.sh/): -`brew install mongo-c-driver`. - -*On Linux*: please follow the [instructions](http://mongoc.org/libmongoc/current/installing.html#building-on-unix) from `libmongoc`'s documentation. Note that the versions provided by your package manager may be too old, in which case you can follow the instructions for building and installing from source. - -See example installation from source on Ubuntu in [Docker](https://github.com/mongodb/mongo-swift-driver/tree/master/Examples/Docker). +To install those libraries, please follow the [instructions](http://mongoc.org/libmongoc/current/installing.html#prerequisites-for-libmongoc) from `libmongoc`'s documentation. ### Step 2: Install MongoSwift -*Please follow the instructions in the previous section on installing the MongoDB C Driver before proceeding.* - Add MongoSwift to your dependencies in `Package.swift`: ```swift From 41ca275425d091aaf00d23a51b2d3bac7989aa42 Mon Sep 17 00:00:00 2001 From: Patrick Freed Date: Fri, 14 Feb 2020 14:09:52 -0500 Subject: [PATCH 2/2] update issue template --- .github/ISSUE_TEMPLATE.md | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 2c3071281..71be27442 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -31,10 +31,6 @@ What does this command give you? ``` $ cat Package.resolved # Applies if you are using Swift package manager ``` -*or* -``` -$ cat Podfile.lock # Applies if you are using Cocoapods -``` ### What is the version(s) of `mongod` that you are running with the driver? @@ -53,28 +49,6 @@ or, running this in a MongoDB shell connected to the relevant node(s): How is your MongoDB deployment configured? -### How did you install `libmongoc` and `libbson` on your system - -Did you use `brew`? Did you install them manually? etc. - - -### Version of `libmongoc` and `libbson` - -What does this command give you? -``` -$ brew list --versions mongo-c-driver # Applies if you installed via brew -``` -*or* -``` -$ apt list --installed | grep -E '(libmongoc|libbson)' # Applies if you installed via apt -``` -*or* -``` -$ pkg-config --modversion libmongoc-1.0 # Applies if you use pkg-config -$ pkg-config --modversion libbson-1.0 -``` - - ## What is the problem? **BE SPECIFIC**: