{"id":19402651,"url":"https://github.com/cscfi/docker-keystone-swift","last_synced_at":"2025-04-24T07:32:15.879Z","repository":{"id":39383778,"uuid":"460447610","full_name":"CSCfi/docker-keystone-swift","owner":"CSCfi","description":"  A docker image running OpenStack Keystone and OpenStack Swift object storage for integration tests.","archived":false,"fork":false,"pushed_at":"2024-08-20T11:44:55.000Z","size":113,"stargazers_count":3,"open_issues_count":3,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-08-20T13:48:07.704Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CSCfi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-17T13:29:39.000Z","updated_at":"2024-08-20T11:44:21.000Z","dependencies_parsed_at":"2023-12-12T09:28:38.881Z","dependency_job_id":"14c07726-2b8a-4409-991d-ce1927abae4f","html_url":"https://github.com/CSCfi/docker-keystone-swift","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSCfi%2Fdocker-keystone-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSCfi%2Fdocker-keystone-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSCfi%2Fdocker-keystone-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSCfi%2Fdocker-keystone-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CSCfi","download_url":"https://codeload.github.com/CSCfi/docker-keystone-swift/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223945255,"owners_count":17229602,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T11:24:59.115Z","updated_at":"2025-04-24T07:32:15.871Z","avatar_url":"https://github.com/CSCfi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Openstack swift and keystone container image\n\nThis container makes it easy to run *integration tests* against OpenStack Keystone and OpenStack Swift object storage.\nIt is not suitable for production.\n\nThe container starts both a swift and a keystone service so that integration\ntests can run against a single Docker container.\n\nThis image was created as a combination of other existing approaches, none of which served our needs:\n- [Dockerfile from swift](https://github.com/openstack/swift)\n- [dockerswiftaio/docker-swift](https://github.com/NVIDIA/docker-swift)\n- [jeantil/openstack-swift-keystone-docker](https://github.com/jeantil/openstack-swift-keystone-docker)\n\n## Stack\nThis container is based on `python:3.9-slim` and installs tarballs from\n[OpenStack release Wallaby](https://docs.openstack.org/wallaby/install/).\nFurthermore, the image includes [s6-overlay](https://github.com/just-containers/s6-overlay)\nto manage processes.\n\n## Pouta Access Token\nA python script is added to mock the feature in Pouta in which a token from AAI's userinfo can be exchanged for an unscoped token that works with Openstack Keystone. The python server is running in port 5001 and also proxies all other requests to port 5000, meaning all Keystone endpoints work in port 5001 as well.\n\n## How to use this container\nBuild the image with\n\n    docker buildx build -t keystone-swift .\n\nOr for using arm processor architecture, like for Mac's M1.\n\n    docker buildx build --build-arg=\"ARCHITECTURE=aarch64\" -t keystone-swift .\n\nStart the container using the following command:\n\n    docker run -d --init -p 5000:5000 -p 8080:8080 --name keystone-swift keystone-swift\n\nOr use the built images from ghrc.io\n\n    docker run -d --init -p 5000:5000 -p 8080:8080 --name keystone-swift ghcr.io/cscfi/docker-keystone-swift:latest\n\nStop it with\n\n    docker stop keystone-swift\n\nBy default, the image outputs no logs, but you can pass `S6_LOGGING=0` when running the image so that it sends logs to stdout\n\n    docker run -d --init -p 5000:5000 -p 8080:8080 --env S6_LOGGING=0 --name keystone-swift keystone-swift\n\n\nThe following commands are available in the container:\n- openstack\n- keystone\n- swift\n- bash\n\n## Extras\nUse the scripts to generate data into the object storage, and test the endpoints.\n\n## Preconfigured credentials\nThe container comes with 2 preconfigured accounts:\n- admin / superuser\n- swift / veryfast\n\n## Preconfigured projects\nThe container comes with 2 preconfigured projects:\n- service (Service test project) | swift admin user\n- swift-project (Swift test project) | swift admin user\n\n### Keystone Identity v3 accounts\nDefault endpoint http://127.0.0.1:5000/v3\n\n#### Administrative account\n\n    export OS_USERNAME=admin\n    export OS_PASSWORD=superuser\n    export OS_PROJECT_NAME=admin\n    export OS_USER_DOMAIN_NAME=Default\n    export OS_PROJECT_DOMAIN_NAME=Default\n    export OS_AUTH_URL=http://127.0.0.1:5000/v3\n    export OS_IDENTITY_API_VERSION=3\n\n#### swift service account\n\n    export OS_USERNAME=swift\n    export OS_PASSWORD=veryfast\n    export OS_PROJECT_NAME=service\n    export OS_USER_DOMAIN_NAME=Default\n    export OS_PROJECT_DOMAIN_NAME=Default\n    export OS_AUTH_URL=http://127.0.0.1:5000/v3\n    export OS_IDENTITY_API_VERSION=3\n\n### Swift tempAuth accounts\n\nDefault endpoint http://127.0.0.1:8080/auth/v1.0\n\n#### Admin account\n\n    USERNAME=admin\n    PASSWORD=admin\n    TENANT_NAME=admin\n\n#### tester account\n\n    USERNAME=tester\n    PASSWORD=testing\n    TENANT_NAME=test\n\n\n## Sample httpie commands\n\nKeystone Identity v3\n\n    echo '{\"auth\":{\"identity\":{\"methods\":[\"password\"],\"password\":{\"user\":{\"name\":\"swift\",\"domain\":{\"name\":\"Default\"},\"password\":\"veryfast\"}}},\"scope\":{\"project\":{\"domain\":{\"id\":\"default\"},\"name\":\"test\"}}}}' | http POST :5000/v3/auth/tokens\n\nTempAuth\n\n    http http://127.0.0.1:8080/auth/v1.0 X-Storage-User:test:tester X-Storage-Pass:testing\n\n## Sample curl commands\n\nKeystone Identity v3\n\n    curl -X POST -H 'Content-Type: application/json' -d '{\"auth\":{\"identity\":{\"methods\":[\"password\"],\"password\":{\"user\":{\"name\":\"swift\",\"domain\":{\"name\":\"Default\"},\"password\":\"veryfast\"}}},\"scope\":{\"project\":{\"domain\":{\"id\":\"default\"},\"name\":\"test\"}}}}' http://127.0.0.1:5000/v3/auth/tokens\n\nTempAuth\n\n    curl -H 'X-Storage-User: test:tester' -H 'X-Storage-Pass: testing' http://127.0.0.1:8080/auth/v1.0\n\n## S3 API\n\nThis image also comes with S3 API enabled. To use it, generate credentials and use them to authenticate against the S3 API.\nBelow is an example using the credentials with [`s3cmd`](https://github.com/s3tools/s3cmd).\n\nThe swift \u003c-\u003e S3 compatibility has its [limitations described here](https://opendev.org/openstack/swift/src/branch/stable/wallaby/doc/source/s3_compat.rst).\n\n1. Create credentials\n```bash\n$ docker exec -it \u003cimage-id\u003e bash\n$ openstack ec2 credentials create\n+------------+---------------------------------------------------------------------------------------------------------------------------------+\n| Field      | Value                                                                                                                           |\n+------------+---------------------------------------------------------------------------------------------------------------------------------+\n| access     | 0a09f306baa04358aa88e50c4853329f                                                                                                |\n| links      | {'self': 'http://localhost:5000/v3/users/2855fdd6794e4d38b4e14b036094524f/credentials/OS-EC2/0a09f306baa04358aa88e50c4853329f'} |\n| project_id | 3ec1214fab494db0b8e2fb4e8f16b42a                                                                                                |\n| secret     | b15fdf7a8ed947f7afe6fa3b01a376cc                                                                                                |\n| trust_id   | None                                                                                                                            |\n| user_id    | 2855fdd6794e4d38b4e14b036094524f                                                                                                |\n+------------+---------------------------------------------------------------------------------------------------------------------------------+\n\n```\n2. Create s3 config file\n```bash\ncat \u003e s3.cfg \u003c\u003c EOF\n[default]\naccess_key = 0a09f306baa04358aa88e50c4853329f\nsecret_key = b15fdf7a8ed947f7afe6fa3b01a376cc\nhost_base = 127.0.0.1:8080\nhost_bucket = 127.0.0.1:8080\nuse_https = false\n\nEOF\n```\n3. Use s3cmd\n```bash\n# create a bucket\n$ s3cmd -c s3.cfg mb s3://config\nBucket 's3://config/' created\n\n# upload the config file\n$ s3cmd -c s3.cfg put s3.cfg s3://config/s3.cfg\nupload: 's3.cfg' -\u003e 's3://config/s3.cfg'  [1 of 1]\n 176 of 176   100% in    0s     3.33 KB/s  done\n\n# list all objects\n$ s3cmd -c s3.cfg la\n2023-12-11 18:23          176  s3://config/s3.cfg\n```\n\n# License\n\n`docker-keystone-swift` and all it sources are released under MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcscfi%2Fdocker-keystone-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcscfi%2Fdocker-keystone-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcscfi%2Fdocker-keystone-swift/lists"}