Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ccollicutt committed Jun 11, 2014
0 parents commit 3e6cef0
Show file tree
Hide file tree
Showing 10 changed files with 324 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM ubuntu:14.04
MAINTAINER curtis <[email protected]>

# Partially fom http://docs.openstack.org/developer/swift/development_saio.html

# common
RUN apt-get update && apt-get install -y swift python-swiftclient rsync

# proxy
RUN apt-get install -y swift-proxy swift-object memcached python-keystoneclient \
python-swiftclient swift-plugin-s3 python-netifaces \
python-xattr python-memcache

# storage
RUN apt-get install -y swift-account swift-container swift-object

# not sure how valuable dispersion will be...
ADD files/dispersion.conf /etc/swift/dispersion.conf
ADD files/rsyncd.conf /etc/rsyncd.conf
ADD files/swift.conf /etc/swift/swift.conf
ADD files/proxy-server.conf /etc/swift/proxy-server.conf
ADD files/account-server.conf /etc/swift/account-server.conf
ADD files/object-server.conf /etc/swift/object-server.conf
ADD files/container-server.conf /etc/swift/container-server.conf
ADD files/proxy-server.conf /etc/swift/proxy-server.conf
ADD files/startmain.sh /usr/local/bin/startmain.sh
RUN chmod 755 /usr/local/bin/*.sh

EXPOSE 8080

CMD /usr/local/bin/startmain.sh
26 changes: 26 additions & 0 deletions files/account-server.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[DEFAULT]
devices = /srv
mount_check = false
disable_fallocate = true
bind_port = 6012
workers = 1
user = swift
log_facility = LOG_LOCAL2
recon_cache_path = /var/cache/swift
eventlet_debug = true

[pipeline:main]
pipeline = recon account-server

[app:account-server]
use = egg:swift#account

[filter:recon]
use = egg:swift#recon

[account-replicator]
vm_test_mode = yes

[account-auditor]

[account-reaper]
29 changes: 29 additions & 0 deletions files/container-server.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[DEFAULT]
devices = /srv
mount_check = false
disable_fallocate = true
bind_port = 6011
workers = 1
user = swift
log_facility = LOG_LOCAL2
recon_cache_path = /var/cache/swift
eventlet_debug = true
allow_versions = true

[pipeline:main]
pipeline = recon container-server

[app:container-server]
use = egg:swift#container

[filter:recon]
use = egg:swift#recon

[container-replicator]
vm_test_mode = yes

[container-updater]

[container-auditor]

[container-sync]
5 changes: 5 additions & 0 deletions files/dispersion.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[dispersion]
auth_url = http://127.0.0.1:8080/auth/v1.0
auth_user = test:tester
auth_key = testing
endpoint_type = internalURL
59 changes: 59 additions & 0 deletions files/object-expirer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[DEFAULT]
# swift_dir = /etc/swift
user = swift
# You can specify default log routing here if you want:
log_name = object-expirer
log_facility = LOG_LOCAL6
log_level = INFO
#log_address = /dev/log
#
# comma separated list of functions to call to setup custom log handlers.
# functions get passed: conf, name, log_to_console, log_route, fmt, logger,
# adapted_logger
# log_custom_handlers =
#
# If set, log_udp_host will override log_address
# log_udp_host =
# log_udp_port = 514
#
# You can enable StatsD logging here:
# log_statsd_host = localhost
# log_statsd_port = 8125
# log_statsd_default_sample_rate = 1.0
# log_statsd_sample_rate_factor = 1.0
# log_statsd_metric_prefix =

[object-expirer]
interval = 300
# auto_create_account_prefix = .
# report_interval = 300
# concurrency is the level of concurrency o use to do the work, this value
# must be set to at least 1
# concurrency = 1
# processes is how many parts to divide the work into, one part per process
# that will be doing the work
# processes set 0 means that a single process will be doing all the work
# processes can also be specified on the command line and will override the
# config value
# processes = 0
# process is which of the parts a particular process will work on
# process can also be specified on the command line and will overide the config
# value
# process is "zero based", if you want to use 3 processes, you should run
# processes with process set to 0, 1, and 2
# process = 0

[pipeline:main]
pipeline = catch_errors cache proxy-server

[app:proxy-server]
use = egg:swift#proxy
# See proxy-server.conf-sample for options

[filter:cache]
use = egg:swift#memcache
# See proxy-server.conf-sample for options

[filter:catch_errors]
use = egg:swift#catch_errors
# See proxy-server.conf-sample for options
26 changes: 26 additions & 0 deletions files/object-server.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[DEFAULT]
devices = /srv
mount_check = false
disable_fallocate = true
bind_port = 6010
workers = 1
user = swift
log_facility = LOG_LOCAL2
recon_cache_path = /var/cache/swift
eventlet_debug = true

[pipeline:main]
pipeline = recon object-server

[app:object-server]
use = egg:swift#object

[filter:recon]
use = egg:swift#recon

[object-replicator]
vm_test_mode = yes

[object-updater]

[object-auditor]
65 changes: 65 additions & 0 deletions files/proxy-server.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
[DEFAULT]
bind_port = 8080
workers = 1
user = swift
log_facility = LOG_LOCAL1
eventlet_debug = true

[pipeline:main]
# Yes, proxy-logging appears twice. This is so that
# middleware-originated requests get logged too.
pipeline = catch_errors gatekeeper healthcheck proxy-logging cache bulk tempurl slo dlo ratelimit crossdomain tempauth staticweb container-quotas account-quotas proxy-logging proxy-server

[filter:catch_errors]
use = egg:swift#catch_errors

[filter:healthcheck]
use = egg:swift#healthcheck

[filter:proxy-logging]
use = egg:swift#proxy_logging

[filter:bulk]
use = egg:swift#bulk

[filter:ratelimit]
use = egg:swift#ratelimit

[filter:crossdomain]
use = egg:swift#crossdomain

[filter:dlo]
use = egg:swift#dlo

[filter:slo]
use = egg:swift#slo

[filter:tempurl]
use = egg:swift#tempurl

[filter:tempauth]
use = egg:swift#tempauth
user_admin_admin = admin .admin .reseller_admin
user_test_tester = testing .admin
user_test2_tester2 = testing2 .admin
user_test_tester3 = testing3

[filter:staticweb]
use = egg:swift#staticweb

[filter:account-quotas]
use = egg:swift#account_quotas

[filter:container-quotas]
use = egg:swift#container_quotas

[filter:cache]
use = egg:swift#memcache

[filter:gatekeeper]
use = egg:swift#gatekeeper

[app:proxy-server]
use = egg:swift#proxy
allow_account_management = true
account_autocreate = true
23 changes: 23 additions & 0 deletions files/rsyncd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
uid = swift
gid = swift
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
address = 127.0.0.1

[account6012]
max connections = 25
path = /srv/
read only = false
lock file = /var/lock/account6012.lock

[container6011]
max connections = 25
path = /srv/
read only = false
lock file = /var/lock/container6011.lock

[object6010]
max connections = 25
path = /srv/
read only = false
lock file = /var/lock/object6010.lock
56 changes: 56 additions & 0 deletions files/startmain.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

#
# Make the rings if they don't exist already
#

if [ ! -e /etc/swift/account.builder ]; then

cd /etc/swift

# 2^& = 128 we are assuming just one drive
# 1 replica only

swift-ring-builder object.builder create 7 1 1
swift-ring-builder object.builder add r1z1-127.0.0.1:6010/sdb1 1
swift-ring-builder object.builder rebalance
swift-ring-builder container.builder create 7 1 1
swift-ring-builder container.builder add r1z1-127.0.0.1:6011/sdb1 1
swift-ring-builder container.builder rebalance
swift-ring-builder account.builder create 7 1 1
swift-ring-builder account.builder add r1z1-127.0.0.1:6012/sdb1 1
swift-ring-builder account.builder rebalance

fi

#
# Start rsyslog
#

. /etc/default/rsyslog

rsyslogd

#
# Start memcached
#

memcached -u memcache -d

#
# Start swift
#

# this comes from a volume, so need to chown it
chown -R swift:swift /srv

swift-init main start
swift-init start rest

#
# Tail the log file for "docker log $CONTAINER_ID"
#

echo "Starting to tail /var/log/syslog...(hit ctrl-c if you are starting the container in a bash shell)"

tail -n 0 -f /var/log/syslog
4 changes: 4 additions & 0 deletions files/swift.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[swift-hash]
# random unique strings that can never change (DO NOT LOSE)
swift_hash_path_prefix = changeme
swift_hash_path_suffix = changeme

0 comments on commit 3e6cef0

Please sign in to comment.