forked from greenplum-db/pxf-archive
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'pxf-6.x' into 6.8.0-sync
- Loading branch information
Showing
37 changed files
with
774 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
FROM hub.adsw.io/library/gpdb6_regress:latest as base | ||
|
||
# install go, ginkgo and keep env variables which may be used as a part of base image | ||
RUN yum install -y go | ||
ENV GOPATH=$HOME/go | ||
ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin | ||
RUN go install github.com/onsi/ginkgo/ginkgo@latest | ||
|
||
# leave pxf artifacts dir env also | ||
ENV OUTPUT_ARTIFACT_DIR="pxf_tarball" | ||
|
||
# remove unnecessary artifacts and create symlinks | ||
# concource scripts expects gpdb and pxf placed in the same folder | ||
RUN rm /home/gpadmin/bin_gpdb/server-*.tar.gz && \ | ||
mkdir /tmp/build && \ | ||
ln -s /home/gpadmin/gpdb_src /tmp/build/gpdb_src && \ | ||
ln -s /home/gpadmin/bin_gpdb /tmp/build/bin_gpdb | ||
# default working dir - the place where all sources and artifacts are placed | ||
WORKDIR /tmp/build | ||
|
||
# create separate image with files we don't want to keep in base image | ||
FROM base as build | ||
COPY . /tmp/build/pxf_src | ||
RUN source gpdb_src/concourse/scripts/common.bash && \ | ||
install_gpdb && \ | ||
source '/usr/local/greenplum-db-devel/greenplum_path.sh' && \ | ||
mkdir ${OUTPUT_ARTIFACT_DIR} && \ | ||
export SKIP_FDW_BUILD_REASON=0 && \ | ||
pxf_src/concourse/scripts/compile_pxf.bash | ||
|
||
# create test image which prepares base image and keeps only pxf artifacts from build image | ||
FROM base as test | ||
COPY --from=build /tmp/build/${OUTPUT_ARTIFACT_DIR}/pxf.tar.gz /tmp/build/${OUTPUT_ARTIFACT_DIR}/ | ||
COPY --from=build /tmp/build/pxf_src /tmp/build/pxf_src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## How to build PXF Docker image | ||
From the root pxf folder run: | ||
```bash | ||
docker build -t gpdb6_pxf_regress:latest -f arenadata/Dockerfile . | ||
``` | ||
This will build an image called `gpdb6_pxf_regress` with the tag `latest`. This image is based on `gpdb6_regress:latest`, which additionally contains pxf sources and pxf artifacts tarball in `/tmp/build/pxf_src` and `/tmp/build/pxf_tarball` folders respectively. | ||
|
||
## How to test PXF | ||
During the image building phase `compile_pxf.bash` script additionally calls `test` make target, which calls `make -C cli/go/src/pxf-cli test` and `make -C server test` commands. | ||
To additionally test `fdw` and `external-table` parts you may call: | ||
```bash | ||
docker run --rm -it \ | ||
--privileged --sysctl kernel.sem="500 1024000 200 4096" \ | ||
gpdb6_pxf_regress:latest /tmp/build/pxf_src/arenadata/test_in_docker.sh | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
# This script depends on hub.adsw.io/library/gpdb6_pxf_regress | ||
set -exo pipefail | ||
|
||
# manually prepare gpadmin user; test_pxf.bash doesn't tweak gpadmin folder permissions and ssh keys | ||
./gpdb_src/concourse/scripts/setup_gpadmin_user.bash | ||
# unpack gpdb and pxf; run gpdb cluster and pxf server | ||
/tmp/build/pxf_src/concourse/scripts/test_pxf.bash | ||
# tweak necessary folders to run regression tests later | ||
chown gpadmin:gpadmin -R /usr/local/greenplum-db-devel | ||
chown gpadmin:gpadmin -R /tmp/build/pxf_src | ||
|
||
# test fdw and external-table | ||
su - gpadmin -c " | ||
source '/usr/local/greenplum-db-devel/greenplum_path.sh'; | ||
source '/home/gpadmin/gpdb_src/gpAux/gpdemo/gpdemo-env.sh'; | ||
cd /tmp/build/pxf_src/fdw && | ||
make install && | ||
make installcheck && | ||
cd ../external-table/ && | ||
make install && | ||
make installcheck; | ||
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...i/src/main/java/org/greenplum/pxf/api/configuration/PxfJksTextEncryptorConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.greenplum.pxf.api.configuration; | ||
|
||
import io.arenadata.security.encryption.client.configuration.JksTextEncryptorConfiguration; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
@ConditionalOnProperty({"pxf.ssl.jks-store.path", "pxf.ssl.jks-store.password", "pxf.ssl.salt.key"}) | ||
public class PxfJksTextEncryptorConfiguration extends JksTextEncryptorConfiguration { | ||
private final String path; | ||
private final String password; | ||
private final String key; | ||
|
||
public PxfJksTextEncryptorConfiguration(@Value("${pxf.ssl.jks-store.path}") String path, | ||
@Value("${pxf.ssl.jks-store.password}") String password, | ||
@Value("${pxf.ssl.salt.key}") String key) { | ||
this.path = path; | ||
this.password = password; | ||
this.key = key; | ||
} | ||
|
||
@Override | ||
protected String jksStorePath() { | ||
return path; | ||
} | ||
|
||
@Override | ||
protected char[] jksStorePassword() { | ||
return password.toCharArray(); | ||
} | ||
|
||
@Override | ||
protected String secretKeyAlias() { | ||
return key; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.