Skip to content

Commit aae1659

Browse files
committed
WIP: local edits before pip-tools setup
1 parent 7da8fd8 commit aae1659

2 files changed

Lines changed: 80 additions & 75 deletions

File tree

defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ dataverse:
247247
custom_sampledataverses: "{{ playbook_dir }}/custom_sampledata/dataverses"
248248
custom_sampleusers: "{{ playbook_dir }}/custom_sampledata/users"
249249
custom_samplefiles: "{{ playbook_dir }}/custom_sampledata/files"
250-
service_email: noreply@dataverse.yourinstitution.edu
250+
service_email: noreply@dataverse.ucla.edu
251251
smtp: localhost # or the FQDN of your organization's SMTP relay
252252
solr:
253253
download_url: https://archive.apache.org/dist/solr/solr/9.8.0/solr-9.8.0.tgz

ucla_readme.md

Lines changed: 79 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,64 @@
1-
## Local setup (recommended)
1+
## Local Setup (Recommended)
22

33
These instructions assume:
4+
45
- You have already cloned this repository locally:
5-
```
6-
git clone https://github.com/ucla-data-science-center/dataverse-ansible.git
7-
cd dataverse-ansible
8-
```
9-
- You have [Conda](https://docs.conda.io/en/latest/miniconda.html) installed (e.g. via Miniforge or Miniconda).
6+
7+
```bash
8+
git clone https://github.com/ucla-data-science-center/dataverse-ansible.git
9+
cd dataverse-ansible
10+
```
11+
12+
- You have [Conda](https://docs.conda.io/en/latest/miniconda.html) installed (e.g. via [Miniforge](https://github.com/conda-forge/miniforge)).
1013
- Docker is installed and running on your system.
1114

1215
---
1316

14-
### Create the Conda environment
17+
### 1. Create the Conda Environment
1518

16-
To create a consistent development environment, use the provided `environment.yml` file:
19+
To create a consistent development environment using `pip-tools`:
1720

18-
```
19-
conda env create -f environment.yml
20-
conda activate dataverse-ansible
21-
```
21+
```bash
22+
conda env create -f environment.yml
23+
conda activate dataverse-ansible
24+
```
2225

23-
This will install Python 3.11, Ansible, Molecule, and Docker bindings.
26+
This will install:
27+
28+
- Python 3.11
29+
- `pip-tools` (to manage Python packages via lockfiles)
2430

2531
---
2632

27-
### Alternative: Manual environment creation
33+
### 2. Compile and Install Python Dependencies
34+
35+
This project uses [`pip-tools`](https://pip-tools.readthedocs.io/) for dependency management. After activating the environment:
36+
37+
```bash
38+
pip-compile requirements.in
39+
pip-sync
40+
```
2841

29-
If you prefer not to use `environment.yml`, you can create the environment manually:
42+
This will install:
3043

31-
```
32-
conda create -n dataverse-ansible python=3.11 -y
33-
conda activate dataverse-ansible
34-
conda install -c conda-forge ansible molecule docker-py
35-
```
44+
- `ansible-core`
45+
- `molecule`
46+
- `molecule-docker`
47+
- `docker` (Python SDK)
3648

37-
If you plan to use Vagrant with Molecule instead of Docker, install the vagrant plugin:
49+
> You only need to run `pip-compile` again if `requirements.in` changes. Use `pip-sync` to reinstall the locked dependencies.
3850

39-
```
40-
pip install 'molecule[docker]'
41-
```
51+
---
52+
53+
### Optional: Manual Environment Creation
54+
55+
If you prefer not to use `environment.yml` or `pip-tools`, you can manually create and install dependencies:
56+
57+
```bash
58+
conda create -n dataverse-ansible python=3.11 -y
59+
conda activate dataverse-ansible
60+
pip install ansible-core molecule molecule-docker docker
61+
```
4262

4363
---
4464

@@ -48,44 +68,26 @@ The `rocky9` Molecule scenario uses Docker as a provisioner. It relies on a cust
4868
4969
From the root of the cloned repository, run:
5070
51-
```
52-
molecule converge --scenario-name rocky9
53-
```
71+
```bash
72+
molecule converge --scenario-name rocky9
73+
```
5474
5575
This will build a Docker container, install Dataverse, and configure services.
5676
5777
Once complete, you should be able to access Dataverse at:
5878
59-
```
60-
http://localhost:8080
61-
```
79+
http://localhost:8080
80+
81+
**Default admin login:**
6282
63-
Default admin login:
6483
- **Username**: `dataverseAdmin`
65-
- **Password**: defined in `tests/group_vars/vagrant.yml` (look for `dataverse_adminpass`)
84+
- **Password**: defined in `tests/group_vars/vagrant.yml` (see `dataverse_adminpass`)
6685
6786
To verify the server is responding:
6887
69-
```
70-
curl -I http://localhost:8080
71-
```
72-
73-
```
74-
HTTP/1.1 302 Found
75-
Server: Payara Server 6.2025.2 #badassfish
76-
X-Powered-By: Servlet/6.0 JSP/3.1 (Payara Server 6.2025.2 #badassfish Java/Red Hat, Inc./17)
77-
Access-Control-Allow-Origin: *
78-
Access-Control-Allow-Methods: PUT, GET, POST, DELETE, OPTIONS
79-
Access-Control-Allow-Headers: Accept, Content-Type, X-Dataverse-key, Range
80-
Access-Control-Expose-Headers: Accept-Ranges, Content-Range, Content-Encoding
81-
Set-Cookie: JSESSIONID=23f7765f06c1f42ad21f492b85a6; Path=/;SameSite=Lax;SameSite=Lax
82-
Set-Cookie: csfcfc=6Ped8fcWqtJm0q1f2%2BUzSThNbg%2F8; Path=/; HttpOnly;SameSite=Lax
83-
Location: http://localhost:8080/loginpage.xhtml;jsessionid=23f7765f06c1f42ad21f492b85a6?redirectPage=%2Fdataverse.xhtml
84-
Content-Length: 267
85-
Content-Language: en
86-
Content-Type: text/html;charset=UTF-8
87-
X-Frame-Options: SAMEORIGIN
88-
```
88+
```bash
89+
curl -I http://localhost:8080
90+
```
8991
9092
---
9193
@@ -95,42 +97,45 @@ Because the Dataverse installer is not idempotent, it’s recommended to fully r
9597
9698
To stop and delete the container:
9799
98-
```
99-
molecule reset --scenario-name rocky9
100-
```
100+
```bash
101+
molecule reset --scenario-name rocky9
102+
```
103+
104+
Then rebuild with:
101105
102-
Then rebuild with `molecule converge`.
106+
```bash
107+
molecule converge --scenario-name rocky9
108+
```
103109
104110
To open a shell inside the running container:
105111
106-
```
107-
molecule login --scenario-name rocky9
108-
```
112+
```bash
113+
molecule login --scenario-name rocky9
114+
```
109115
110116
To see additional Molecule commands:
111117
112-
```
113-
molecule --help
114-
```
118+
```bash
119+
molecule --help
120+
```
115121
116-
More documentation: https://ansible.readthedocs.io/projects/molecule/
122+
More documentation: [https://ansible.readthedocs.io/projects/molecule/](https://ansible.readthedocs.io/projects/molecule/)
117123
118124
---
119125
120-
## Windows/WSL2 Linux specific changes
121-
122-
If you're using WSL2 with Debian Linux, make the following adjustments (branch: `windows_wsl2_jmj`):
123-
124-
- In `minio.yml`, lines 68 and 79:
125-
Change `community.docker.docker_compose` to `community.docker.docker_compose_v2`
126+
## Notes
126127
127-
- In `tasks/postgres_redhat.yml`, line 11:
128-
Change `-aarch64` to `{{ ansible_distribution_major_version }}-x86_64`
128+
- If port `8080` is already in use on your machine, update the port mapping in `molecule/rocky9/molecule.yml`.
129+
- Ensure Docker Desktop (macOS) or the Docker daemon (Linux/WSL2) is running before launching `molecule converge`.
129130
130131
---
131132
132-
## Notes
133+
## Windows/WSL2 Linux Specific Changes
133134
134-
- If port `8080` is already in use on your machine, update the port mapping in `molecule/rocky9/molecule.yml`.
135-
- Ensure Docker Desktop or your Linux Docker daemon is running before launching `molecule converge`.
135+
If you're using WSL2 with Debian Linux, make the following adjustments (see branch: `windows_wsl2_jmj`):
136136

137+
- In `minio.yml`, lines 68 and 79:
138+
Change `community.docker.docker_compose``community.docker.docker_compose_v2`
139+
140+
- In `tasks/postgres_redhat.yml`, line 11:
141+
Change `-aarch64``{{ ansible_distribution_major_version }}-x86_64`

0 commit comments

Comments
 (0)