-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docker, scorecard] add docker base image, use in scorecard #5623
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,26 @@ | ||
FROM ubuntu:18.04 | ||
|
||
RUN apt-get update && \ | ||
apt-get -y install \ | ||
htop \ | ||
unzip bzip2 \ | ||
wget curl \ | ||
emacs25-nox \ | ||
default-jdk \ | ||
python3 python3-pip && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN python3 -m pip install -U \ | ||
pip decorator pylint pytest flake8 \ | ||
requests \ | ||
jinja2 \ | ||
aiohttp aiodns aiohttp_jinja2 uvloop>=0.12 \ | ||
werkzeug flask flask-cors Flask_Sockets \ | ||
kubernetes google-cloud-storage \ | ||
PyGithub cerberus humanize libsass authlib | ||
|
||
# source: https://cloud.google.com/storage/docs/gsutil_install#linux | ||
RUN /bin/sh -c 'curl https://sdk.cloud.google.com | bash' && \ | ||
mv /root/google-cloud-sdk / && \ | ||
/google-cloud-sdk/bin/gcloud components install beta kubectl | ||
ENV PATH $PATH:/google-cloud-sdk/bin |
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,11 @@ | ||
FROM base | ||
|
||
RUN wget -O spark-2.2.0-bin-hadoop2.7.tgz https://archive.apache.org/dist/spark/spark-2.2.0/spark-2.2.0-bin-hadoop2.7.tgz && \ | ||
tar xzf spark-2.2.0-bin-hadoop2.7.tgz && \ | ||
rm spark-2.2.0-bin-hadoop2.7.tgz | ||
|
||
RUN wget -O /spark-2.2.0-bin-hadoop2.7/jars/gcs-connector-hadoop2-latest.jar https://storage.googleapis.com/hadoop-lib/gcs/gcs-connector-hadoop2-latest.jar | ||
COPY core-site.xml /spark-2.2.0-bin-hadoop2.7/conf/core-site.xml | ||
|
||
ENV SPARK_HOME /spark-2.2.0-bin-hadoop2.7 | ||
ENV PATH "$PATH:$SPARK_HOME/sbin:$SPARK_HOME/bin" |
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,21 @@ | ||
.PHONY: build push deploy | ||
|
||
PROJECT = $(shell gcloud config get-value project) | ||
|
||
BASE_IMAGE = gcr.io/$(PROJECT)/base:$(shell docker images -q --no-trunc base:latest | sed -e 's,[^:]*:,,') | ||
SPARK_BASE_IMAGE = gcr.io/$(PROJECT)/spark-base:$(shell docker images -q --no-trunc spark-base:latest | sed -e 's,[^:]*:,,') | ||
|
||
build: | ||
-docker pull ubuntu:18.04 | ||
-docker pull gcr.io/$(PROJECT)/base | ||
-docker pull gcr.io/$(PROJECT)/spark-base | ||
docker build . -t base -f Dockerfile.base --cache-from base,ubuntu:18.04 | ||
docker build . -t spark-base -f Dockerfile.spark-base --cache-from spark-base,base,ubuntu:18.04 | ||
|
||
push: build | ||
docker tag base $(BASE_IMAGE) | ||
docker push $(BASE_IMAGE) | ||
docker tag spark-base $(SPARK_BASE_IMAGE) | ||
docker push $(SPARK_BASE_IMAGE) | ||
|
||
deploy: push |
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,16 @@ | ||
<?xml version="1.0"?> | ||
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> | ||
|
||
<configuration> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How is this file used? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's used in the spark-base image to configure the Google hadoop connector. |
||
|
||
<property> | ||
<name>google.cloud.auth.service.account.enable</name> | ||
<value>true</value> | ||
</property> | ||
|
||
<property> | ||
<name>google.cloud.auth.service.account.json.keyfile</name> | ||
<value>/hail-vdc-sa-key/hail-vdc-sa-key.json</value> | ||
</property> | ||
|
||
</configuration> |
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,9 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
gcloud -q auth activate-service-account \ | ||
--key-file=/secrets/gcr-push-service-account-key.json | ||
|
||
gcloud -q auth configure-docker | ||
|
||
make deploy |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
FROM continuumio/miniconda | ||
MAINTAINER Hail Team <[email protected]> | ||
|
||
COPY environment.yml . | ||
RUN conda env create scorecard -f environment.yml && \ | ||
rm -f environment.yml && \ | ||
rm -rf /home/root/.conda/pkgs/* | ||
FROM base | ||
|
||
COPY scorecard /scorecard | ||
|
||
EXPOSE 5000 | ||
|
||
CMD ["bash", "-c", "source activate scorecard; python /scorecard/scorecard.py"] | ||
CMD ["bash", "-c", "python3 /scorecard/scorecard.py"] |
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 was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add
asyncinit
? https://github.com/kchmck/pyasyncinit I'm going to use this for the MySQL PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.