Skip to content
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

Update to latest code in dockerhub #5

Open
ellis opened this issue Jan 4, 2020 · 35 comments
Open

Update to latest code in dockerhub #5

ellis opened this issue Jan 4, 2020 · 35 comments

Comments

@ellis
Copy link

ellis commented Jan 4, 2020

Following the README instruction creates an installation with a various random errors when trying to read messages.

However, when I downloaded your code and built the docker image from scratch, things ran just fine.
Could you please rebuild the image and update it in dockerhub so we get the current cypht version again?

@marclaporte
Copy link
Member

marclaporte commented Jan 6, 2020

wow 100K+ pulls of https://hub.docker.com/r/sailfrog/cypht-docker

@t-m-w
Copy link

t-m-w commented Feb 4, 2020

Thank you. I wish I had seen this sooner. I was not receiving random errors, but a very consistent "Server Error" bar at the top of the page (or 500 from a POST in the nginx logs) whenever trying to load anything, including emails and feed items. The logs showed nothing to explain this. Even Debug Mode was not showing any explanation. Building it myself eliminated this problem.

@conspacer
Copy link

Same issue as @t-m-w .
However building from scratch does not work for me. There is an error in the build process (I will post output here shortly.)
Question: Is there a plan to maintain a current image in Docker hub to just pull?

@csuno
Copy link

csuno commented Aug 16, 2021

i also want to see a code-update on docker-hub. Please :)
and a Version indicator, would be great.

THX

@marclaporte
Copy link
Member

Agreed for an update.

Some information:

  1. The project evolved from a personal repo to an organization: https://unencumberedbyfacts.com/2023/06/14/cypht-rebooted/ so the commit review process and release process is now handled by a team.
  2. @rodriguezny started modernizing the Docker package: [UPD] Update the base image to php:7.4-fpm-alpine #20
  3. We have yet to update https://hub.docker.com/r/sailfrog/cypht-docker
  4. We'll soon e-meet to discuss this. Can you join us?

@marclaporte
Copy link
Member

and a Version indicator, would be great.

FYI, Cypht's admin panel now indicates revision (one more reason to update our Docker)
cypht-org/cypht#638

@marclaporte
Copy link
Member

marclaporte commented Aug 18, 2023

@wangxiaoerYah wrote: "Can I add Docker workflow to the current branch? Instead of in another repository, I want to create two docker branches for it, stable and nightly." Source: cypht-org/cypht#748

The Cypht development model has evolved: https://github.com/cypht-org/cypht/wiki/Lifecycle so it totally makes sense to have stable and nightly.

As to doing within this repo or the other: I don't know. This should be discussed by the community.

@marclaporte
Copy link
Member

@ellis @t-m-w @conspacer @csuno @wangxiaoerYah: Please share your thoughts and indicate if you can be present at the meeting about this with @mose, @rodriguezny, @josaphatim and myself.

Thanks!

@wangxiaoerYah
Copy link

If you build a docker image and create stable and nightly branches, you need to improve code review and functional testing. But I am not proficient in PHP, if you need to start, I will provide the help I can.

The most important thing is PHP code testing. Unlike static languages, as long as the compilation passes, there will generally be no problems. Might need more help with this. We can refer to other webmail projects, how they implement code testing.

@wangxiaoerYah
Copy link

I checked the action market, maybe this should work

phpunit

As long as the test check is deployed, there will be no major problems in subsequent compilation of the docker image.

After that, the project development will be on the right track, only need stable maintenance, and review, it can allow more users to participate, because docker will make the installation process easier and easier to understand.

@wangxiaoerYah
Copy link

Today I tried to reproduce the test steps that this project used to host on travis, maybe this is more complicated than I thought.😂

If you want to implement it on GitHub, you need to modify a lot of files. I wonder if the developer plans to use GitHub action to build a test process?

@marclaporte

@marclaporte
Copy link
Member

We (Rodriguez, Josaphat, mose and I) held a Cypht-Docker meeting. Takeaways:

1- https://github.com/cypht-org/cypht/wiki will be updated to explain how thing will work (Lifecycle, how to contribute, etc.)

2- Docker aspects will eventually be brought in main repo, we won't maintain a distinct repo like now: https://github.com/cypht-org/cypht-docker

3- Josaphat will review everything related to the CI, and discuss with mose for questions. The CI should run for all Docker builds.

@wangxiaoerYah
Copy link

我们(Rodriguez、Josaphat、mose 和我)召开了 Cypht-Docker 会议。要点:

1- https://github.com/cypht-org/cypht/wiki将更新以解释事物如何工作(生命周期、如何贡献等)

2- Docker 方面最终将引入主存储库,我们不会像现在一样维护一个独特的存储库:https://github.com/cypht-org/cypht-docker

3- Josaphat将审查与CI相关的所有内容,并与mose讨论问题。CI 应该针对所有 Docker 构建运行。

This is great! ! ! ! !

@marclaporte
Copy link
Member

3- Josaphat will review everything related to the CI, and discuss with mose for questions. The CI should run for all Docker builds.

Progress: cypht-org/cypht#755

@wangxiaoerYah
Copy link

@josaphatim Is it necessary to test selenium in Action ci? I tried it for a few hours on my dev branch and I feel that if I enable selenium tests, it is tedious on github ci and they depend on too many things and I have to do it on a lot of Switch between os images and maintain specific dependencies for specific systems. I think we should abandon the old software package dependencies and embrace the latest version.

@wangxiaoerYah
Copy link

It requires php-fpm dependency, but there is no php7.4-fpm in ubuntu20. I tried to get it running and tried many times, but it had some problems.
dev

@wangxiaoerYah
Copy link

@marclaporte @josaphatim @kroky

Can you guys help me figure out what I'm doing wrong? Is it a missing dependency that's causing the compiled index.php to be missing elements?

github action

AttributeError: 'WebDriver' object has no attribute 'find_element_by_name'

Is this caused by adding the '--headless' parameter when starting chrome? Or is there a problem with my dependencies, resulting in incomplete page compilation? Because I see composer install showing many repeated warnings.

@kroky
Copy link
Member

kroky commented Oct 10, 2023

Selenium 4.3.0 removes find_element_by_name method. Maybe you are using too new version? Try with an older one.
https://github.com/SeleniumHQ/selenium/blob/a4995e2c096239b42c373f26498a6c9bb4f2b3e7/py/CHANGES

@wangxiaoerYah
Copy link

Selenium 4.3.0 removes find_element_by_name method. Maybe you are using too new version? Try with an older one.
https://github.com/SeleniumHQ/selenium/blob/a4995e2c096239b42c373f26498a6c9bb4f2b3e7/py/CHANGES

I updated the code and selenium has started running, but I still cannot pass the test. This is my latest progress:action

@wangxiaoerYah
Copy link

Selenium 4.3.0 removes find_element_by_name method. Maybe you are using too new version? Try with an older one.
https://github.com/SeleniumHQ/selenium/blob/a4995e2c096239b42c373f26498a6c9bb4f2b3e7/py/CHANGES

Hello, can I add your matrix account? So maybe I can contact you better.

@wangxiaoerYah
Copy link

@kroky Did selenium run normally when you tested it? There seemed to be some errors when I tested it on Github action.

servers PASSED
 - finding element by class menu_settings
 - waiting for page by class name: main_menu ...
site FAILED
Traceback (most recent call last):
  File "/home/runner/work/cypht/cypht/tests/selenium/runner.py", line 16, in run_tests
    func()
  File "/home/runner/work/cypht/cypht/tests/selenium/./pages.py", line 104, in site
    self.wait_with_folder_list()
 - finding element by class menu_folders
  File "/home/runner/work/cypht/cypht/tests/selenium/base.py", line 121, in wait_with_folder_list
    self.wait(By.CLASS_NAME, "main_menu")
  File "/home/runner/work/cypht/cypht/tests/selenium/base.py", line 114, in wait
    element = WebDriverWait(self.driver, timeout).until(
  File "/home/runner/.local/lib/python3.10/site-packages/selenium/webdriver/support/wait.py", line 95, in until
    raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: 
Stacktrace:
#0 0x55fc6ecaa933 <unknown>
#1 0x55fc6e9846f7 <unknown>
#2 0x55fc6e9cbaa6 <unknown>
#3 0x55fc6e9cbb91 <unknown>
#4 0x55fc6ea08fc4 <unknown>
#5 0x55fc6e9ed62d <unknown>
#6 0x55fc6ea06857 <unknown>
#7 0x55fc6e9ed3d3 <unknown>
#8 0x55fc6e9bfe64 <unknown>
#9 0x55fc6e9c0c4e <unknown>
#10 0x55fc6ec70558 <unknown>
#11 0x55fc6ec744a0 <unknown>
#12 0x55fc6ec7e97c <unknown>
#13 0x55fc6ec750b8 <unknown>
#14 0x55fc6ec40cdf <unknown>
#15 0x55fc6ec99048 <unknown>
#16 0x55fc6ec99219 <unknown>
#17 0x55fc6eca9ac3 <unknown>
#18 0x7f4972e94b43 <unknown>

@kroky
Copy link
Member

kroky commented Oct 10, 2023

I remember having hard time running selenium but managed to run it at the end. Will check it later and reply...

@wangxiaoerYah
Copy link

I remember having hard time running selenium but managed to run it at the end. Will check it later and reply...

You can refer to my dev branch, although the quality of my code is terrible. Well, if the code is fixed, I hope it can run directly in the project root path, just to make it look good, without switching paths 🤣🤣. Waiting for you Message, remember to @ me, remember to @ me, thank you, I am very happy to be with you.

@kroky
Copy link
Member

kroky commented Oct 11, 2023

@wangxiaoerYah
OK, I managed to run all of the selenium tests locally against an external postfix server but had to push a bit of fixes here: cypht-org/cypht#791

Can you try latest latest master?

I see a couple of issues in your setup:

  • enable account module in hm3.ini to run some specific tests
  • I met timeout error when my external server firewall blocked my local system because of too many logins - selenium tests issue quite a bunch of requests to the postfix server in short amount of time, so normal firewalls block at some point. I had to ignore my IP to run them successfully. Check your env setup and preferrably disable all firewalls in the github ci...
  • some tests depend on the external mail server being able to send messages and have specific messages in its mail account inbox (e.g. search test is searching for keyword 'test'). If you see them failing, please artificially add some emails to the inbox or whatever is missing.

Also, feel free to modify the tests, so they run regardless of the mail server settings and state - this will be best but will require some more time that I lack now...

@wangxiaoerYah
Copy link

@wangxiaoerYah
OK, I managed to run all of the selenium tests locally against an external postfix server but had to push a bit of fixes here: cypht-org/cypht#791

Can you try latest latest master?

I see a couple of issues in your setup:

  • enable account module in hm3.ini to run some specific tests
  • I met timeout error when my external server firewall blocked my local system because of too many logins - selenium tests issue quite a bunch of requests to the postfix server in short amount of time, so normal firewalls block at some point. I had to ignore my IP to run them successfully. Check your env setup and preferrably disable all firewalls in the github ci...
  • some tests depend on the external mail server being able to send messages and have specific messages in its mail account inbox (e.g. search test is searching for keyword 'test'). If you see them failing, please artificially add some emails to the inbox or whatever is missing.

Also, feel free to modify the tests, so they run regardless of the mail server settings and state - this will be best but will require some more time that I lack now...

This is great news and thank you for your work. I'll experiment later in me👍👍👍

@wangxiaoerYah
Copy link

wangxiaoerYah commented Oct 12, 2023

@kroky @marclaporte @josaphatim

  • composer suggest prompts for missing dependencies, should they be installed?

In my dev branch, I forcibly upgraded the PHP dependencies to completely deprecate PHP7.4. The selenium test looked fine. However, the phpunit test still did not work properly. I tried some modifications, but I had no idea.
selenium
phpunit

After I improved the dependencies, there is still a package that depends on the previous version of the library.

> composer suggest
paragonie/random_compat suggests:
 - ext-libsodium: Provides a modern crypto API that can be used to generate random bytes.

ext-libsodium is already built-in in php7. Is there any replacement for this package?

Is it possible to give up support for lower versions of PHP? I think the optimization of the latest version must be better than the previous version.

Also, I am going to create a docker compilation workflow, do you have any good suggestions?

@kroky
Copy link
Member

kroky commented Oct 16, 2023

@wangxiaoerYah , I don't see an error in your phpunit pipeline - maybe try to run phpunit in verbose or even debug mode to see why it is returning a non-zero exit code.

sodium extension is part of php in all versions after 7.2 but it should be compiled with that when libsodium is available on the system. Any modern php package coming from OS package management systems should have it - I have mostly used Ubuntu.

We will deprecate and remove support for PHP versions that reached EOL one day but it is a discussion to be held. There are still a lot of places where PHP7 is supported/used.

I don't have experience with docker compilation workflows, sorry.

@marclaporte
Copy link
Member

@wangxiaoerYah Are you good? What is the next step?

Tks

@wangxiaoerYah
Copy link

@wangxiaoerYah Are you good? What is the next step?

Tks

I can't pass the selenium test. Because of the local configuration of smtp and imap, my local configuration is normal smtp and imap, but when it comes to the action, I don't know why it can't connect.

I made some settings on my dev branch, you can refer to it.

https://github.com/wangxiaoerYah/cypht/tree/dev/.github

SMTP and imap are very difficult.

😂😂😂😂

@kroky
Copy link
Member

kroky commented Nov 6, 2023

Maybe we merge what we have here and I continue by setting up the proper postfix config in the pipeline, so selenium tests can execute there?

@wangxiaoerYah
Copy link

Maybe we merge what we have here and I continue by setting up the proper postfix config in the pipeline, so selenium tests can execute there?

@marclaporte @kroky I pushed the submission to the mainline, hoping to merge it. The problem has not been solved, and I hope you can provide help.

@marclaporte
Copy link
Member

@wangxiaoerYah
Copy link

The good, the bad and the ugly: We need a Docker expert to guide us!

emm, i'd love to help but i don't have much time. i've been watching this project.

@marclaporte
Copy link
Member

@wangxiaoerYah Are you a Docker expert? It won't take much time from someone who has done this many times before.

@marclaporte
Copy link
Member

https://hub.docker.com/u/cypht will soon have the latest code, and we will automate so all future updates are easily available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants