-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Specify 6.8.03 Static Files to Specify 7 #5266
Conversation
We'll need to edit the Specify 7 nginx web-server to not depend on the Specify 6 container as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there still appears to be a lot of files in this PR that are not needed by specify 7.
could you search the back-end and front-end for usages, and delete the needless files?
or would you prefer Jason or I look over these?
Here are the initial notes I made from going through the code-base, searching file and directory names. Keep:
Maybe Keep:
Probably Remove:
Remove:
Going through the files in the directories to further filter out files. |
Ah, what I mean is that inside each of these folders there are several files that are probably not needed anymore: accessions
backstop
bird
botany
common
defaultperms
fish
herpetology
invertebrate
invertpaleo
mammal
paleobotany
vertpaleo dataentry_task.xml, search_config.xml, startup_panel.xml and etc there also appear to be many reports/labels files - you will need to check with Grant on these but I was under impression that all reports are hand-crafted or done in jasper studio/irepo, so I am not sure what these files are about |
@acwhite211 yes, icons are still used, but only for compatibility with sp6 forms. Sp6 static files include a fixed set of low resolution icons that people can include in their forms. Instead of using these legacy icon names, Specify 7 already supports specifying icon image URLs. Those URLs could point to your local asset server, or any external file server. Thus the workflow could be:
Note, this change means that icons that icons display in sp6 won't be displayed in sp7 without some form changes. If that is too much of a breaking change at this point, then we can delay the deprecation till later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without any modification, this branch is not working for me.
Initially, when running docker compose up --build
, it fails because the specify6
service was defined yet invalid as the specify6
volume was not being created.
specify6:
image: specifyconsortium/specify6-service:6.8.03
volumes:
- "specify6:/volumes/Specify"
After commenting the above bit out, I try to run it again. Immediately, I see this error:
specify7-1 | FileNotFoundError: [Errno 2] No such file or directory: '/opt/specify7/specify.jar'
I check to see that this is actually missing:
docker-compose run --rm specify7 ls -l /opt/specify7/config
and see
~/GitHub/specify7 on issue-4828 ⇣1 *1 +1 !2 ❯ docker-compose run --rm specify7 ls -l /opt/specify7/config at 01:37:27 PM
WARN[0000] /Users/g584f396/GitHub/specify7/docker-compose.yml: `version` is obsolete
[+] Creating 1/0
✔ Container specify7-webpack-1 Running 0.0s
total 11900
lrwxrwxrwx 1 root root 49 Aug 17 02:57 DataExporter_64.desktop -> .install4j/install4j_15dyqoe-DataExporter.desktop
lrwxrwxrwx 1 root root 55 Aug 17 02:57 ImportFileSplitter_64.desktop -> .install4j/install4j_15dyqoe-ImportFileSplitter.desktop
lrwxrwxrwx 1 root root 52 Aug 17 02:57 SpBackupRestore_64.desktop -> .install4j/install4j_15dyqoe-SpBackupRestore.desktop
lrwxrwxrwx 1 root root 45 Aug 17 02:57 SpWizard_64.desktop -> .install4j/install4j_15dyqoe-SpWizard.desktop
lrwxrwxrwx 1 root root 47 Aug 17 02:57 Specify4GB_64.desktop -> .install4j/install4j_15dyqoe-Specify4GB.desktop
lrwxrwxrwx 1 root root 60 Aug 17 02:57 SpecifyDBSecurityWizard_64.desktop -> .install4j/install4j_15dyqoe-SpecifyDBSecurityWizard.desktop
lrwxrwxrwx 1 root root 44 Aug 17 02:57 Specify_64.desktop -> .install4j/install4j_15dyqoe-Specify.desktop
lrwxrwxrwx 1 root root 46 Aug 17 02:57 SpiReport_64.desktop -> .install4j/install4j_15dyqoe-SpiReport.desktop
drwxr-xr-x 2 root root 4096 Aug 17 02:57 bin
drwxr-xr-x 21 root root 4096 Aug 17 02:57 config
drwxr-xr-x 2 root root 4096 Aug 17 02:57 demo_files
drwxr-xr-x 7 root root 4096 Aug 17 02:57 help
drwxr-xr-x 2 root root 4096 Aug 17 02:57 hibernate_libs
drwxr-xr-x 2 root root 4096 Aug 17 02:57 iReportLibs
drwxr-xr-x 2 root root 4096 Aug 17 02:57 libs
-rw-r--r-- 1 root root 15590 Mar 1 2023 license_agreement.html
-rw-r--r-- 1 root root 4996 Mar 1 2023 non-mac-application-adapter.jar
drwxr-xr-x 2 root root 4096 Mar 1 2023 plugins
-rw-r--r-- 1 root root 446 Mar 1 2023 readme.html
-rw-r--r-- 1 root root 12097156 Mar 1 2023 specify.jar
-rwx------ 1 root root 14045 Mar 1 2023 uninstall
drwxr-xr-x 2 root root 4096 Aug 17 02:57 wwlibs
So we can verify that specify.jar
is accessible within the container at /opt/specify7/config/specify.jar
.
Now it seems the SPECIFY_THICK_CLIENT
location may be causing the issue. I can fix the issue I see in the specify7-1
container upon startup by changing it in the specify_settings.py
file:
# Specify 7 requires the files from a Specify 6 install.
# This setting should point to a directory containing an installation
# of Specify 6 of the same version as the Specify database.
THICK_CLIENT_LOCATION = '/opt/specify7'
Adding /config
looks like this:
THICK_CLIENT_LOCATION = '/opt/specify7/config'
Now no startup errors! However, this of course doesn't solve the problem. Now the other files aren't accessible properly, so naturally an error appears:
@acwhite211 How have you been testing this? Am I missing something? When you can, please provide testing instructions.
Icons are also used when thumbnails aren't generated for attachments and for table headings in the WorkBench (until #5176)
I agree that this should be done, but I believe this is not the right time due to other pressing priorities. We must focus our efforts on delivering GeoSpecify on schedule. This should be spun off into a different issue. |
@acwhite211 There is no need to keep any of the |
config/backstop/app_resources.xml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while this file is used at the moment, could we refactor back-end to not use app_resources.xml files?
e.g aren't all UIFormatters XML files of the same name, thus removing the need for this file?
it seems that this file is used at present to tell specify what files are defined in a given folder - wouldn't it be better to simply check if the file is present on the file system?
</altviews> | ||
</view> | ||
|
||
<view name="WorkbenchTemplate" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we remove views for sp6-only tables?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this entire file could potentially be removed - need to double check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of views for tables here that are only defined in this file:
- Address
- AgentSpecialty
- Agent
- AgentVariant
- GroupPerson
- Author
- Journal
- ReferenceWork
- TaxonCitation
- Taxon
- Geography
- Storage
- GeologicTimePeriod
- LithoStrat
- (All of the TreeDefItem forms)
- ObjectAttachmenmt
- CollectionObjectAttachment
The other views defined here can likely be removed
</altviews> | ||
</view> | ||
|
||
<view name="ChangePassword" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove.
search for all views that don't have a class="edu.ku.brc.specify.datamodel.*
attribute and consider removing them
config/schema_localization.xml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it safe to remove schema localization for sp6-only tables or is it too early for that?
@maxpatiiuk We are finalizing this PR and will address your comments in a future PR. Thank you for your feedback! 😄 I'll open a new issue with your comments soon if you don't beat me to it. |
that means all these useless files will end up in the repository's git history forever 😮💨 edit: I guess that's ok. Jason already filtered out most of the needless files |
TODO:
|
PR for editing Specify Cloud deployment https://github.com/specify/docker-compositions/pull/32 For the test-panel, the main change is to edit nginx rewrite for config to static-files volume path. The current solution will require all new branches to have config in the Specify 7 container, instead of in a separate Specify 6 container. Further work will be needed in order to support new and old branches where the config location is different for the nginx rewrite path to point to. Need a good way of specifying if a branch uses the new or old config setup. We'll need to add a way to check to see if the branch has the config directory in the Specify 7 filesystem from the |
Fixes #4828
Fixes #5258
Copy the config directory from Specify 6 into Specify 7 so that the Specify 6 docker container doesn't need to be spun up with the Specify 7 container. Also, edit the
THICK_CLIENT_LOCATION
in the specify settings so that theSPECIFY_CONFIG_DIR
gets set to the new path. The nginx configuration file also needs to be edited to the new config directory path.This is simply moving the default static files from Specify 6 to Specify 7. This will not override custom client specific configs that have been added to the database, since Specify 7 first looks in the database and then in the filesystem:
specify7/specifyweb/context/app_resource.py
Lines 53 to 71 in f58f0d4
Note for this Draft PR, not all the files in the Specify 6 config directory are needed. So identifying the files that are not actually ever used by Specify 7 and then pruning those from the Specify 7 config directory still needs to be done as of the creation of this Draft PR.
If we only had to worry about hosted instances, it would be nice just to put these files in S3. Another option to explore, if anyone wants to, would be creating a Django migration to add these default configs as blobs into the database and adding a default field.
Checklist
and self-explanatory (or properly documented)
Testing instructions
TBD