Skip to content

Commit be15c34

Browse files
sfc-gh-stakedasfc-gh-abhatnagar
authored andcommitted
SNOW-132958 SNOW-104556 copied connector scripts into sub-directory and added py38 support
1 parent 14f1b9c commit be15c34

30 files changed

+1418
-1
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# We use manylinux1 base image because pyarrow_manylinux2010 has a bug and wheel failed to be audited
2+
FROM quay.io/pypa/manylinux2010_x86_64
3+
4+
# This is to solve permission issue, read https://denibertovic.com/posts/handling-permissions-with-docker-volumes/
5+
RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.11/gosu-amd64"
6+
RUN chmod +x /usr/local/bin/gosu
7+
8+
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
9+
RUN chmod +x /usr/local/bin/entrypoint.sh
10+
11+
12+
WORKDIR /home/user
13+
RUN chmod 777 /home/user
14+
ENV PATH="${PATH}:/opt/python/cp35-cp35m/bin:/opt/python/cp36-cp36m/bin:/opt/python/cp37-cp37m/bin:/opt/python/cp38-cp38/bin/"
15+
16+
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# Add local user
4+
# Either use the LOCAL_USER_ID if passed in at runtime or
5+
# fallback
6+
7+
USER_ID=${LOCAL_USER_ID:-9001}
8+
9+
echo "Starting with UID : $USER_ID"
10+
useradd --shell /bin/bash -u $USER_ID -o -c "" -m user
11+
export HOME=/home/user
12+
13+
/usr/local/bin/gosu user "$@"

scripts/anaconda/bld.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$PYTHON setup.py install

scripts/anaconda/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$PYTHON setup.py install --single-version-externally-managed --record=record.txt

scripts/anaconda/meta.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package:
2+
name: snowflake_connector_python
3+
version: "1.2.3"
4+
5+
source:
6+
path: /tmp/anaconda_workspace/src
7+
8+
requirements:
9+
build:
10+
- python
11+
- setuptools
12+
13+
run:
14+
- python
15+
- boto3 ==1.3.1
16+
- botocore ==1.4.26
17+
- future
18+
- six
19+
- pytz
20+
- pycrypto ==2.6.1
21+
- pyopenssl ==0.15.1
22+
- cryptography ==1.2.3
23+
- cffi ==1.6.0
24+
25+
about:
26+
home: https://www.snowflake.net/
27+
license: Apache 2.0
28+
license_file: /tmp/anaconda_workspace/src/LICENSE.txt
29+
summary: Snowflake Connector for Python

scripts/build.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash -e
2+
#
3+
# Build Snowflake SQLAlchemy for Python
4+
#
5+
THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6+
SQLALCHEMY_DIR="$( dirname "${THIS_DIR}")"
7+
source $THIS_DIR/build_init.sh
8+
9+
cleanup_workspace
10+
is_up_to_date "$SQLALCHEMY_DIR/dist/snowflake_sqlalchemy*$python_svn_revision*.whl" "SQLALCHEMY_DIR" && exit 0
11+
generate_version_file $RELEASE_PACKAGE
12+
create_wheel
13+
if [[ -n "$RELEASE_PACKAGE" ]]; then
14+
create_sdist
15+
fi

scripts/build_docker.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash -x
2+
3+
THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4+
CONNECTOR_DIR="$( dirname "${THIS_DIR}")"
5+
6+
mkdir -P $CONNECTOR_DIR/dist
7+
cd $CONNECTOR_DIR/docker/manylinux2010
8+
9+
CONTAINER_NAME=build_connector
10+
11+
echo "[Info] Start building docker image"
12+
docker build -t manylinux:1.0 -f Dockerfile-x86_64_base .
13+
14+
user_id=$(id -u $USER)
15+
docker run -it \
16+
-e TERM=vt102 \
17+
-e PIP_DISABLE_PIP_VERSION_CHECK=1 \
18+
-e LOCAL_USER_ID=$user_id \
19+
--mount type=bind,source="$CONNECTOR_DIR",target=/home/user/snowflake-connector-python \
20+
manylinux:1.0 \
21+
/home/user/snowflake-connector-python/scripts/build_pyarrow_linux.sh $1

0 commit comments

Comments
 (0)