Skip to content

Commit f6842e2

Browse files
ajkiesslwhereismyjetpack
andauthored
M1 compatibility (#578)
* updates ruby * Some changes to make etda workflow work with m1 macs * upgrade docker ci-utils image to 3.0.0 for all ci builds * Adds selenium container back in to e used in ci * update readme and adds container name Co-authored-by: whereismyjetpack <djb44@psu.edu>
1 parent 080bd6b commit f6842e2

File tree

4 files changed

+34
-25
lines changed

4 files changed

+34
-25
lines changed

.circleci/config.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
./bin/pr-release clusters/prod/manifests/prod.yaml
2222
build:
2323
docker:
24-
- image: harbor.k8s.libraries.psu.edu/library/ci-utils:v2.0.1
24+
- image: harbor.k8s.libraries.psu.edu/library/ci-utils:v3.0.0
2525
environment:
2626
REGISTRY_HOST: harbor.k8s.libraries.psu.edu
2727
REGISTRY_URL: harbor.k8s.libraries.psu.edu/library/etda-workflow
@@ -55,7 +55,7 @@ jobs:
5555
- cc-test-reporter
5656
rubocop:
5757
docker:
58-
- image: harbor.k8s.libraries.psu.edu/library/ci-utils:v1.1.0
58+
- image: harbor.k8s.libraries.psu.edu/library/ci-utils:v3.0.0
5959
environment:
6060
REGISTRY_HOST: harbor.k8s.libraries.psu.edu
6161
REGISTRY_URL: harbor.k8s.libraries.psu.edu/library/etda-workflow
@@ -74,7 +74,7 @@ jobs:
7474
RAILS_ENV=test docker-compose run --name=rubocop test bundle exec rubocop
7575
integration_test_grad:
7676
docker:
77-
- image: harbor.k8s.libraries.psu.edu/library/ci-utils:v1.1.0
77+
- image: harbor.k8s.libraries.psu.edu/library/ci-utils:v3.0.0
7878
environment:
7979
REGISTRY_HOST: harbor.k8s.libraries.psu.edu
8080
REGISTRY_URL: harbor.k8s.libraries.psu.edu/library/etda-workflow
@@ -101,7 +101,7 @@ jobs:
101101
- integration_coverage.json
102102
unit_test_grad:
103103
docker:
104-
- image: harbor.k8s.libraries.psu.edu/library/ci-utils:v1.1.0
104+
- image: harbor.k8s.libraries.psu.edu/library/ci-utils:v3.0.0
105105
environment:
106106
REGISTRY_HOST: harbor.k8s.libraries.psu.edu
107107
REGISTRY_URL: harbor.k8s.libraries.psu.edu/library/etda-workflow
@@ -128,7 +128,7 @@ jobs:
128128
- unit_coverage.json
129129
publish:
130130
docker:
131-
- image: harbor.k8s.libraries.psu.edu/library/ci-utils:v1.1.0
131+
- image: harbor.k8s.libraries.psu.edu/library/ci-utils:v3.0.0
132132
environment:
133133
REGISTRY_HOST: harbor.k8s.libraries.psu.edu
134134
REGISTRY_URL: harbor.k8s.libraries.psu.edu/library/etda-workflow
@@ -164,7 +164,7 @@ jobs:
164164
docker push $REGISTRY_URL:latest
165165
test_partners:
166166
docker:
167-
- image: harbor.k8s.libraries.psu.edu/library/ci-utils:v1.1.0
167+
- image: harbor.k8s.libraries.psu.edu/library/ci-utils:v3.0.0
168168
environment:
169169
REGISTRY_HOST: harbor.k8s.libraries.psu.edu
170170
REGISTRY_URL: harbor.k8s.libraries.psu.edu/library/etda-workflow

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
[![Maintainability](https://api.codeclimate.com/v1/badges/a38c9040c48fe53aaa85/maintainability)](https://codeclimate.com/github/psu-libraries/etda_workflow/maintainability)
33
[![Test Coverage](https://api.codeclimate.com/v1/badges/a38c9040c48fe53aaa85/test_coverage)](https://codeclimate.com/github/psu-libraries/etda_workflow/test_coverage)
44

5-
# Electronic Theses and Dissertations Workflow
5+
# Electronic Theses and Dissertations Workflow
66

77
* Ruby version: 2.7
88
* Node version 10 (using yarn as npm)
99
* Rails 6
1010
* Redis 3
1111
* Sidekiq 5
1212
* Mariadb 10
13-
13+
1414
## Setup
1515

1616
Clone the repo to your local device and `cd` to the project root directory
@@ -19,43 +19,43 @@ Clone the repo to your local device and `cd` to the project root directory
1919

2020
*Run `make` or view the Makefile for target definitions*
2121

22-
To build the image and run containers:
22+
To build the image and run necessary containers:
2323

24-
1. `make build`
25-
2. `make up`
24+
1. `docker-compose build`
25+
2. `docker-compose up -d seleniarm db redis web` **_Note:_** Use `seleniarm` with ARM architecture and `selenium` with others
2626
3. Check it out at `localhost:3000` in your browser
27-
27+
2828
To copy database data into container:
2929

3030
1. Retrieve an sql dump or compressed backup of the prod or staging database
3131
2. `docker cp /path/to/file.sql.gz {db_container}:/`
32-
3. `docker-compose exec db bash`
32+
3. `docker-compose exec db bash`
3333
4. Unzip file if compressed using `gunzip`
34-
5. `mysql -u root -p -D {database_name} < /path/to/file.sql`
35-
34+
5. `mysql -u root -p -D {database_name} < /path/to/file.sql`
35+
3636
To create mock submission files:
3737

3838
*This should be done after the database data is created, or else nothing will be created*
3939

40-
1. `make exec` (running bash in the web container)
40+
1. `docker-compose exec web bash` (running bash in the web container)
4141
2. `rake etda_files:create:empty_files` (this may take a while)
4242

4343
To seed data:
4444

45-
1. `make exec`
45+
1. `docker-compose exec web bash`
4646
2. `PARTNER={parter} bundle exec rake db:seed:essential`
47-
47+
4848
You're good to go from here! Any changes made in the project files on your local machine will automatically be updated in the container. Run `make restart` to restart the puma server if changes do not appear in the web browser. Remember to check the Makefile for more commands. If you are running a shell in the web container, you can run all of the rails commands you would normally use for development: ie `rspec, rails restart, rails c, etc.`
4949

5050
## Testing
51-
52-
To run the tests:
51+
52+
To run the tests:
5353
1. `RAILS_ENV=test bundle exec rspec` tests Graduate School instance
5454
2. `RAILS_ENV=test bundle exec PARTNER=honors rspec` tests Honors College instance
5555
3. `RAILS_ENV=test PARTNER=milsch bundle exec rspec` tests Millennium Scholars instance
56-
56+
5757
Running the entire test suite for each partner can take a while. To run tests for non-graduate instances that are unique to that instance, use tags like this:
58-
58+
5959
1. `RAILS_ENV=test PARTNER=milsch bundle exec rspec --tag milsch`
6060
1. `RAILS_ENV=test PARTNER=honors bundle exec rspec --tag honors`
6161

config/environments/development.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@
7777

7878
# Use an evented file watcher to asynchronously detect changes in source code,
7979
# routes, locales, etc. This feature depends on the listen gem.
80-
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
80+
# config.file_watcher = ActiveSupport:: EventedFileUpdateChecker // this code doesn't work with M1 chip MacBooks
81+
config.file_watcher = ActiveSupport::FileUpdateChecker
8182

8283
# Mocks
8384
# TODO Remove constants from initializer (autoload to deprecate in future Rails versions)

docker-compose.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
version: '3.5'
22
services:
3+
# Can be used locally with M1 Macs in place of the selenuim container
4+
seleniarm:
5+
image: seleniarm/standalone-chromium
6+
volumes:
7+
- /dev/shm:/dev/shm
8+
ports:
9+
- "4444:4444"
10+
container_name: selenium
311
selenium:
412
image: selenium/standalone-chrome
513
volumes:
@@ -26,7 +34,7 @@ services:
2634
user: root
2735
image: etda_workflow_web:latest
2836
# build:
29-
# context: .
37+
# context: .
3038
# target: base
3139
environment:
3240
JS: ${JS:-false}
@@ -56,7 +64,7 @@ services:
5664
stdin_open: true
5765
user: root
5866
build:
59-
context: .
67+
context: .
6068
target: base
6169
environment:
6270
REDIS_HOST: redis

0 commit comments

Comments
 (0)