Skip to content

Commit

Permalink
Updated docker-related files based on 6.17.0
Browse files Browse the repository at this point in the history
 - Legacy-Id: 10967
  • Loading branch information
levkowetz committed Mar 22, 2016
1 parent 7b65e26 commit 02d341c
Show file tree
Hide file tree
Showing 12 changed files with 338 additions and 172 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# Simulated Subversion default ignores end here
/.project
/.pydevproject
/.Python
/.settings
/.coverage
/unix.tag
Expand All @@ -30,6 +31,8 @@
/lib
/share
/include
/pip-selfcheck.json
/settings_local.py
/static
/latest-coverage.json
/ghostdriver.log
3 changes: 3 additions & 0 deletions data/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/ietf_utf8.bin.tar.bz2
/ietf_utf8.sql.gz
/mysql
/.com.apple.backupd.*
/developers
/nomcom_keys
11 changes: 9 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,29 +40,36 @@ RUN apt-get update && apt-get install -qy \
libsvn1/wheezy-backports \
libxml2-dev \
libxslt-dev \
locales \
mysql-server \
openssh-client \
procps \
pv \
python \
python-dev \
python-m2crypto \
rsync \
subversion/wheezy-backports \
sudo \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Enable some common locales
RUN sed -i -e 's/^. en_US/en_US/' -e 's/^. en_GB/en_GB/' -e 's/^. en_IE/en_IE/' /etc/locale.gen
RUN locale-gen

# Set up root password
RUN echo "root:root" | chpasswd

# MySQL
VOLUME /var/lib/mysql

# Pip
ENV PYTHONWARNINGS="ignore:a true SSLContext object"
ENV PYTHONWARNINGS="ignore:a true SSLContext object,ignore:An HTTPS request has been made"
WORKDIR /usr/src
RUN wget -q https://bootstrap.pypa.io/get-pip.py && python get-pip.py && rm get-pip.py
RUN pip install certifi
RUN pip install virtualenv

# idnits and dependencies
Expand All @@ -73,7 +80,7 @@ RUN mkdir -p $DDIR
WORKDIR $DDIR

COPY requirements.txt ./
RUN pip install -r requirements.txt
RUN pip --no-cache-dir install -r requirements.txt

COPY settings_local.py ./
COPY setprompt ./
Expand Down
43 changes: 42 additions & 1 deletion docker/docker-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,50 @@ if [ ! -f $VIRTDIR/lib/site-python/settings_local.py ]; then
cp /usr/local/share/datatracker/settings_local.py $VIRTDIR/lib/site-python/
fi

for sub in test/id/ test/staging/ test/archive/; do
dir="/home/$USER/$CWD/$sub"
if [ ! -d "$dir" ]; then
echo "Creating dir $dir"
mkdir -p "$dir";
fi
done

for sub in \
nomcom_keys/public_keys \
developers/ietf-ftp \
developers/ietf-ftp/internet-drafts \
developers/ietf-ftp/rfc \
developers/ietf-ftp/charter \
developers/ietf-ftp/status-changes \
developers/ietf-ftp/conflict-reviews \
developers/www6s \
developers/www6s/staging \
developers/www6s/wg-descriptions \
developers/www6s/proceedings \
developers/www6/ \
developers/www6/iesg \
developers/www6/iesg/evaluation \
; do
dir="/home/$USER/$CWD/data/$sub"
if [ ! -d "$dir" ]; then
echo "Creating dir $dir"
mkdir -p "$dir";
fi
done

if [ ! -f "/home/$USER/$CWD/test/data/draft-aliases" ]; then
echo "Generating draft aliases ..."
ietf/bin/generate-draft-aliases }
fi

if [ ! -f "/home/$USER/$CWD/test/data/group-aliases" ]; then
echo "Generating group aliases ..."
ietf/bin/generate-wg-aliases }
fi

chown -R $USER /opt/home/$USER

cd /home/$USER/$CWD || cd /home/$USER/
cd "/home/$USER/$CWD" || cd "/home/$USER/"

echo "Done!"

Expand Down
16 changes: 5 additions & 11 deletions docker/run
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,8 @@ done
# The program itself

if [ "$(uname)" != "Linux" ]; then
if [ -n "$(type -p boot2docker)" ]; then
machine=$(type -p boot2docker)
up=up
env=shellinit
elif [ -n "$(type -p docker-machine)" ]; then
if [ -n "$(type -p docker-machine)" ]; then
machine=$(type -p docker-machine)
up=start
env="env default"
else
die "Could not find boot2docker or docker-machine -- you need to set one of those before running this script."
fi
Expand All @@ -138,13 +132,13 @@ else
fi


if [ $($machine status) != "running" ]; then
echo "The docker VM doesn't seem to be running; will attempt to start it by doing '\$ $machine $up':"
$machine $up || die "Failed taking up the Docker VM"
if [ $($machine status default) != "Running" ]; then
echo "The docker VM doesn't seem to be running; will attempt to start it by doing '\$ $machine start':"
$machine start || die "Failed taking up the Docker VM"
fi

if [ -f "$machine" ]; then
if [ $($machine status | tr "A-Z" "a-z") = "running" ]; then
if [ $($machine status | tr "A-Z" "a-z") = "Running" ]; then
tmpfile=$(mktemp docker.run.XXXXXXXX)
if $machine $env 2>/dev/null | grep DOCKER_ > $tmpfile; then
mv $tmpfile ~/.docker-info
Expand Down
3 changes: 3 additions & 0 deletions docker/settings_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
}

IDSUBMIT_IDNITS_BINARY = "/usr/local/bin/idnits"
IDSUBMIT_REPOSITORY_PATH = "test/id/"
IDSUBMIT_STAGING_PATH = "test/staging/"
INTERNET_DRAFT_ARCHIVE_DIR = "test/archive/"
4 changes: 2 additions & 2 deletions ietf/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def check_group_email_aliases_exists(app_configs, **kwargs):
ok = check_group_email_aliases()
if not ok:
errors.append(checks.Error(
"Found no aliases in the group email aliases file",
"Found no aliases in the group email aliases file\n'%s'."%settings.GROUP_ALIASES_PATH,
hint="Please run ietf/bin/generate-wg-aliases to generate them.",
obj=None,
id="datatracker.E0002",
Expand All @@ -53,7 +53,7 @@ def check_doc_email_aliases_exists(app_configs, **kwargs):
ok = check_doc_email_aliases()
if not ok:
errors.append(checks.Critical(
"Found no aliases in the document email aliases file.",
"Found no aliases in the document email aliases file\n'%s'."%settings.DRAFT_ALIASES_PATH,
hint="Please run ietf/bin/generate-draft-aliases to generate them.",
obj=None,
id="datatracker.E0004",
Expand Down
3 changes: 3 additions & 0 deletions test/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/*.pyc
/archive
/id
/staging
/sql_setup.sql
Loading

0 comments on commit 02d341c

Please sign in to comment.