Skip to content

Commit e02ce05

Browse files
authored
chore: make /assets a named volume for dev container (ietf-tools#4018)
* chore: make /assets a static volume for dev container * chore: fix create-dirs script to point to /assets
1 parent 159f89e commit e02ce05

10 files changed

Lines changed: 76 additions & 68 deletions

.devcontainer/docker-compose.extend.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ services:
88
- .:/workspace
99
- /workspace/.parcel-cache
1010
- /workspace/__pycache__
11+
- app-assets:/assets
1112
- datatracker-vscode-ext:/root/.vscode-server/extensions
1213
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
1314
network_mode: service:db

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@ services:
6060

6161
volumes:
6262
mariadb-data:
63+
app-assets:

docker/app.Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,5 @@ USER dev:dev
4848
COPY requirements.txt /tmp/pip-tmp/
4949
RUN pip3 --disable-pip-version-check --no-cache-dir install --user --no-warn-script-location -r /tmp/pip-tmp/requirements.txt
5050
RUN sudo rm -rf /tmp/pip-tmp
51+
52+
VOLUME [ "/assets" ]

docker/base.Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf
125125
ADD https://raw.githubusercontent.com/eficode/wait-for/v2.1.3/wait-for /usr/local/bin/
126126
RUN chmod +rx /usr/local/bin/wait-for
127127

128+
# Create assets directory
129+
RUN mkdir -p /assets
130+
128131
# Create workspace
129132
RUN mkdir -p /workspace
130133
WORKDIR /workspace

docker/configs/settings_local.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,25 @@
3131
INTERNET_ALL_DRAFTS_ARCHIVE_DIR = "test/archive/"
3232
RFC_PATH = "test/rfc/"
3333

34-
AGENDA_PATH = 'data/developers/www6s/proceedings/'
34+
AGENDA_PATH = '/assets/www6s/proceedings/'
3535
MEETINGHOST_LOGO_PATH = AGENDA_PATH
3636

3737
USING_DEBUG_EMAIL_SERVER=True
3838
EMAIL_HOST='localhost'
3939
EMAIL_PORT=2025
4040

41-
MEDIA_BASE_DIR = 'data/developers'
41+
MEDIA_BASE_DIR = '/assets'
4242
MEDIA_ROOT = MEDIA_BASE_DIR + '/media/'
4343
MEDIA_URL = '/media/'
4444

4545
PHOTOS_DIRNAME = 'photo'
4646
PHOTOS_DIR = MEDIA_ROOT + PHOTOS_DIRNAME
4747

48-
SUBMIT_YANG_CATALOG_MODEL_DIR = 'data/developers/ietf-ftp/yang/catalogmod/'
49-
SUBMIT_YANG_DRAFT_MODEL_DIR = 'data/developers/ietf-ftp/yang/draftmod/'
50-
SUBMIT_YANG_INVAL_MODEL_DIR = 'data/developers/ietf-ftp/yang/invalmod/'
51-
SUBMIT_YANG_IANA_MODEL_DIR = 'data/developers/ietf-ftp/yang/ianamod/'
52-
SUBMIT_YANG_RFC_MODEL_DIR = 'data/developers/ietf-ftp/yang/rfcmod/'
48+
SUBMIT_YANG_CATALOG_MODEL_DIR = '/assets/ietf-ftp/yang/catalogmod/'
49+
SUBMIT_YANG_DRAFT_MODEL_DIR = '/assets/ietf-ftp/yang/draftmod/'
50+
SUBMIT_YANG_INVAL_MODEL_DIR = '/assets/ietf-ftp/yang/invalmod/'
51+
SUBMIT_YANG_IANA_MODEL_DIR = '/assets/ietf-ftp/yang/ianamod/'
52+
SUBMIT_YANG_RFC_MODEL_DIR = '/assets/ietf-ftp/yang/rfcmod/'
5353

5454
# Set INTERNAL_IPS for use within Docker. See https://knasmueller.net/fix-djangos-debug-toolbar-not-showing-inside-docker
5555
import socket
@@ -60,15 +60,15 @@
6060
# 'ietf.context_processors.sql_debug',
6161
# ]
6262

63-
DOCUMENT_PATH_PATTERN = 'data/developers/ietf-ftp/{doc.type_id}/'
64-
INTERNET_DRAFT_PATH = 'data/developers/ietf-ftp/internet-drafts/'
65-
RFC_PATH = 'data/developers/ietf-ftp/rfc/'
66-
CHARTER_PATH = 'data/developers/ietf-ftp/charter/'
67-
BOFREQ_PATH = 'data/developers/ietf-ftp/bofreq/'
68-
CONFLICT_REVIEW_PATH = 'data/developers/ietf-ftp/conflict-reviews/'
69-
STATUS_CHANGE_PATH = 'data/developers/ietf-ftp/status-changes/'
70-
INTERNET_DRAFT_ARCHIVE_DIR = 'data/developers/ietf-ftp/internet-drafts/'
71-
INTERNET_ALL_DRAFTS_ARCHIVE_DIR = 'data/developers/ietf-ftp/internet-drafts/'
63+
DOCUMENT_PATH_PATTERN = '/assets/ietf-ftp/{doc.type_id}/'
64+
INTERNET_DRAFT_PATH = '/assets/ietf-ftp/internet-drafts/'
65+
RFC_PATH = '/assets/ietf-ftp/rfc/'
66+
CHARTER_PATH = '/assets/ietf-ftp/charter/'
67+
BOFREQ_PATH = '/assets/ietf-ftp/bofreq/'
68+
CONFLICT_REVIEW_PATH = '/assets/ietf-ftp/conflict-reviews/'
69+
STATUS_CHANGE_PATH = '/assets/ietf-ftp/status-changes/'
70+
INTERNET_DRAFT_ARCHIVE_DIR = '/assets/ietf-ftp/internet-drafts/'
71+
INTERNET_ALL_DRAFTS_ARCHIVE_DIR = '/assets/ietf-ftp/internet-drafts/'
7272

7373
NOMCOM_PUBLIC_KEYS_DIR = 'data/nomcom_keys/public_keys/'
7474
SLIDE_STAGING_PATH = 'test/staging/'

docker/configs/settings_local_sqlitetest.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def __getitem__(self, item):
5656
INTERNET_ALL_DRAFTS_ARCHIVE_DIR = "test/archive/"
5757
RFC_PATH = "test/rfc/"
5858

59-
AGENDA_PATH = 'data/developers/www6s/proceedings/'
59+
AGENDA_PATH = '/assets/www6s/proceedings/'
6060
MEETINGHOST_LOGO_PATH = AGENDA_PATH
6161

6262
USING_DEBUG_EMAIL_SERVER=True
@@ -70,12 +70,12 @@ def __getitem__(self, item):
7070
PHOTOS_DIRNAME = 'photo'
7171
PHOTOS_DIR = MEDIA_ROOT + PHOTOS_DIRNAME
7272

73-
DOCUMENT_PATH_PATTERN = 'data/developers/ietf-ftp/{doc.type_id}/'
73+
DOCUMENT_PATH_PATTERN = '/assets/ietf-ftp/{doc.type_id}/'
7474

75-
SUBMIT_YANG_CATALOG_MODEL_DIR = 'data/developers/ietf-ftp/yang/catalogmod/'
76-
SUBMIT_YANG_DRAFT_MODEL_DIR = 'data/developers/ietf-ftp/yang/draftmod/'
77-
SUBMIT_YANG_INVAL_MODEL_DIR = 'data/developers/ietf-ftp/yang/invalmod/'
78-
SUBMIT_YANG_IANA_MODEL_DIR = 'data/developers/ietf-ftp/yang/ianamod/'
79-
SUBMIT_YANG_RFC_MODEL_DIR = 'data/developers/ietf-ftp/yang/rfcmod/'
75+
SUBMIT_YANG_CATALOG_MODEL_DIR = '/assets/ietf-ftp/yang/catalogmod/'
76+
SUBMIT_YANG_DRAFT_MODEL_DIR = '/assets/ietf-ftp/yang/draftmod/'
77+
SUBMIT_YANG_INVAL_MODEL_DIR = '/assets/ietf-ftp/yang/invalmod/'
78+
SUBMIT_YANG_IANA_MODEL_DIR = '/assets/ietf-ftp/yang/ianamod/'
79+
SUBMIT_YANG_RFC_MODEL_DIR = '/assets/ietf-ftp/yang/rfcmod/'
8080

8181
DE_GFM_BINARY = '/usr/local/bin/de-gfm'

docker/docker-compose.extend.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ services:
88
- .:/workspace
99
- /workspace/.parcel-cache
1010
- /workspace/__pycache__
11+
- app-assets:/assets
1112
db:
1213
ports:
1314
- '3306'

docker/scripts/app-create-dirs.sh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@ for sub in \
88
test/media \
99
test/wiki/ietf \
1010
data/nomcom_keys/public_keys \
11-
data/developers/ietf-ftp \
12-
data/developers/ietf-ftp/bofreq \
13-
data/developers/ietf-ftp/charter \
14-
data/developers/ietf-ftp/conflict-reviews \
15-
data/developers/ietf-ftp/internet-drafts \
16-
data/developers/ietf-ftp/rfc \
17-
data/developers/ietf-ftp/status-changes \
18-
data/developers/ietf-ftp/yang/catalogmod \
19-
data/developers/ietf-ftp/yang/draftmod \
20-
data/developers/ietf-ftp/yang/ianamod \
21-
data/developers/ietf-ftp/yang/invalmod \
22-
data/developers/ietf-ftp/yang/rfcmod \
23-
data/developers/www6s \
24-
data/developers/www6s/staging \
25-
data/developers/www6s/wg-descriptions \
26-
data/developers/www6s/proceedings \
27-
data/developers/www6/ \
28-
data/developers/www6/iesg \
29-
data/developers/www6/iesg/evaluation \
30-
data/developers/media/photo \
11+
/assets/ietf-ftp \
12+
/assets/ietf-ftp/bofreq \
13+
/assets/ietf-ftp/charter \
14+
/assets/ietf-ftp/conflict-reviews \
15+
/assets/ietf-ftp/internet-drafts \
16+
/assets/ietf-ftp/rfc \
17+
/assets/ietf-ftp/status-changes \
18+
/assets/ietf-ftp/yang/catalogmod \
19+
/assets/ietf-ftp/yang/draftmod \
20+
/assets/ietf-ftp/yang/ianamod \
21+
/assets/ietf-ftp/yang/invalmod \
22+
/assets/ietf-ftp/yang/rfcmod \
23+
/assets/www6s \
24+
/assets/www6s/staging \
25+
/assets/www6s/wg-descriptions \
26+
/assets/www6s/proceedings \
27+
/assets/www6/ \
28+
/assets/www6/iesg \
29+
/assets/www6/iesg/evaluation \
30+
/assets/media/photo \
3131
; do
3232
if [ ! -d "$sub" ]; then
3333
echo "Creating dir $sub"

docker/scripts/app-init.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
WORKSPACEDIR="/workspace"
44

5-
sudo service rsyslog start
5+
sudo service rsyslog start &>/dev/null
66

77
# Fix ownership of volumes
88
echo "Fixing volumes ownership..."
99
sudo chown -R dev:dev "$WORKSPACEDIR/.parcel-cache"
1010
sudo chown -R dev:dev "$WORKSPACEDIR/__pycache__"
11+
sudo chown dev:dev "/assets"
1112

1213
echo "Fix chromedriver /dev/shm permissions..."
1314
sudo chmod 1777 /dev/shm

docker/scripts/app-rsync-extras.sh

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
version=0.11
3+
version=0.12
44
program=${0##*/}
55
progdir=${0%/*}
66
if [ "$progdir" = "$program" ]; then progdir="."; fi
@@ -23,7 +23,7 @@ DESCRIPTION
2323
from the ietf server to a local directory, for instance drafts,
2424
charters, rfcs, agendas, minutes, etc.
2525
26-
If no destination is given, the default is data/developers.
26+
If no destination is given, the default is /assets.
2727
2828
OPTIONS
2929
EOF
@@ -32,15 +32,15 @@ EOF
3232
3333
AUTHOR
3434
Written by:
35-
Henrik Levkowetz, <henrik@levkowetz.com>
35+
Henrik Levkowetz, <henrik@levkowetz.com>
3636
Lars Eggert, <lars@eggert.org>
3737
3838
COPYRIGHT
3939
Copyright (c) 2016 IETF Trust and the persons identified as authors of
4040
the code. All rights reserved. Redistribution and use in source and
4141
binary forms, with or without modification, is permitted pursuant to,
4242
and subject to the license terms contained in, the Revised BSD
43-
License set forth in Section 4.c of the IETF Trusts Legal Provisions
43+
License set forth in Section 4.c of the IETF Trust's Legal Provisions
4444
Relating to IETF Documents(https://trustee.ietf.org/license-info).
4545
4646
EOF
@@ -61,52 +61,51 @@ trap 'echo "$program($LINENO): Command failed with error code $? ([$$] $0 $*)";
6161

6262

6363
# Option parsing
64-
shortopts=hvV
64+
shortopts=hv
6565
args=$(getopt -o$shortopts $*)
6666
if [ $? != 0 ] ; then die "Terminating..." >&2 ; exit 1 ; fi
6767
set -- $args
6868

6969
while true ; do
7070
case "$1" in
71-
-h) usage; exit;; # Show this help, then exit
72-
-v) VERBOSE=1;; # Be more talkative
73-
-V) version; exit;; # Show program version, then exit
74-
--) shift; break;;
75-
*) die "Internal error, inconsistent option specification: '$1'";;
71+
-h) usage; exit;; # Show this help, then exit
72+
-v) version; exit;; # Show program version, then exit
73+
--) shift; break;;
74+
*) die "Internal error, inconsistent option specification: '$1'";;
7675
esac
7776
shift
7877
done
7978

8079
# The program itself
8180
if [ $# -lt 1 ]; then
82-
DEST_ROOT=data/developers
81+
DEST_ROOT=/assets
8382
else
8483
DEST_ROOT="${1%/}"
8584
fi
8685
echo "Using destination $DEST_ROOT"
8786

8887
for dir in bofreq; do
89-
dest="$DEST_ROOT/ietf-ftp/$dir"
90-
mkdir -p "$dest"
91-
echo "Fetching $dest ..."
92-
rsync -auz ${VERBOSE:+--info=progress2} rsync.ietf.org::$dir/ $dest/
88+
dest="$DEST_ROOT/ietf-ftp/$dir"
89+
mkdir -p "$dest"
90+
echo "Fetching $dest ..."
91+
rsync -auz --info=progress2 rsync.ietf.org::$dir/ $dest/
9392
done
9493

9594
for dir in charter conflict-reviews internet-drafts review rfc slides status-changes yang; do
96-
dest="$DEST_ROOT/ietf-ftp/$dir"
97-
mkdir -p "$dest"
98-
echo "Fetching $dest ..."
99-
rsync -auz ${VERBOSE:+--info=progress2} rsync.ietf.org::everything-ftp/$dir/ $dest/
95+
dest="$DEST_ROOT/ietf-ftp/$dir"
96+
mkdir -p "$dest"
97+
echo "Fetching $dest ..."
98+
rsync -auz --info=progress2 rsync.ietf.org::everything-ftp/$dir/ $dest/
10099
done
101100

102101
for dir in floor photo; do
103-
dest="$DEST_ROOT/media/$dir"
104-
mkdir -p "$dest"
105-
echo "Fetching $dest ..."
106-
rsync -auz ${VERBOSE:+--info=progress2} rsync.ietf.org::dev.media/$dir/ $dest/
102+
dest="$DEST_ROOT/media/$dir"
103+
mkdir -p "$dest"
104+
echo "Fetching $dest ..."
105+
rsync -auz --info=progress2 rsync.ietf.org::dev.media/$dir/ $dest/
107106
done
108107

109108
dest="$DEST_ROOT/archive/id"
110109
mkdir -p "$dest"
111110
echo "Fetching $dest ..."
112-
rsync -auz ${VERBOSE:+--info=progress2} rsync.ietf.org::id-archive/ $dest/
111+
rsync -auz --info=progress2 rsync.ietf.org::id-archive/ $dest/

0 commit comments

Comments
 (0)