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

msi: migration to c:\opt\fluent #494

Merged
merged 9 commits into from
Jul 14, 2023
Merged

msi: migration to c:\opt\fluent #494

merged 9 commits into from
Jul 14, 2023

Conversation

kenhys
Copy link
Contributor

@kenhys kenhys commented Jun 8, 2023

msi: migrate to c:\opt\fluent

Before:

  • Configuration c:\opt\td-agent\etc\td-agent\td-agent.conf
  • Log files: c:\opt\td-agent

After:

  • Move configuration to c:\opt\fluent\etc\fluent\td-agent.conf
  • Create symbolic link to c:\opt\fluent\etc\fluent from c:\opt\td-agent\etc\td-agent.
  • Overwrite c:\opt\fluent\etc\fluentd.conf with td-agent.conf (when upgrade)
  • Migrate to FLUENT_PACKAGE_TOPDIR environment variable.
  • Keep old logs as is:

@kenhys kenhys changed the title msi: migration to c:\opt\fluent Draft msi: migration to c:\opt\fluent Jun 8, 2023
@kenhys kenhys force-pushed the win-migration branch 6 times, most recently from 7ec01d6 to 9a06366 Compare June 19, 2023 07:28
@kenhys
Copy link
Contributor Author

kenhys commented Jun 19, 2023

debug-msi.log

InstallExecuteSequence doesn't work as expected 🤔

@kenhys
Copy link
Contributor Author

kenhys commented Jun 19, 2023

newly install works as expected, not for upgrade.
pr494-new-install.log
pr494-upgrade.log

@kenhys
Copy link
Contributor Author

kenhys commented Jun 19, 2023

Unexpectedly action was skipped this action should not executed during upgrade.

MSI (s) (50:1C) [16:52:42:112]: Note: 1: 2265 2:  3: -2147287035 
MSI (s) (50:1C) [16:52:42:112]: Server not locked: locking for product {4FEF158E-E67C-4D05-B7E2-55DA1B33AF9F}
Action ended 16:52:42: InstallInitialize. Return value 1.
MSI (s) (50:1C) [16:52:42:125]: Skipping action: SetDeleteCompatTdAgentBat (condition is false)
MSI (s) (50:1C) [16:52:42:125]: Skipping action: DeleteCompatTdAgentBat (condition is false)
MSI (s) (50:1C) [16:52:42:125]: Skipping action: SetDeleteCompatTdAgentGemBat (condition is false)
MSI (s) (50:1C) [16:52:42:125]: Skipping action: DeleteCompatTdAgentGemBat (condition is false)
MSI (s) (50:1C) [16:52:42:125]: Doing action: ProcessComponents
MSI (s) (50:1C) [16:52:42:125]: Note: 1: 2205 2:  3: ActionText 
Action 16:52:42: ProcessComponents. Updating component registration
Action start 16:52:42: ProcessComponents.

@kenhys
Copy link
Contributor Author

kenhys commented Jun 19, 2023

PostInstall action is called.

MSI (s) (50:1C) [16:53:06:342]: Executing op: ActionStart(Name=PostInstall,,)
Action 16:53:06: PostInstall. 
MSI (s) (50:1C) [16:53:06:344]: Executing op: CustomActionSchedule(Action=PostInstall,ActionType=3073,Source=BinaryData,Target=WixQuietExec64,CustomActionData="c:\opt\fluent\bin\fluent-package-post-install.bat")
MSI (s) (50:B4) [16:53:06:352]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSICEAC.tmp, Entrypoint: WixQuietExec64
WixQuietExec64:  Restoring gems to pristine condition...
WixQuietExec64:  Skipped error_highlight-0.5.1, it is a default gem

@kenhys
Copy link
Contributor Author

kenhys commented Jun 19, 2023

postinstall's if exist "%~dp0..\..\td-agent" ( condition may not be evaluated expectedly 🤔

@kenhys
Copy link
Contributor Author

kenhys commented Jun 20, 2023

check error log:
upgrade.take1.rollback.zip

@kenhys
Copy link
Contributor Author

kenhys commented Jun 20, 2023

check error log: upgrade.take1.rollback.zip

Should align not expected WixQuietExec64 execution order.

@kenhys
Copy link
Contributor Author

kenhys commented Jun 21, 2023

upgrade-echo-on.u8.log
tracked via @echo on, but it seems that the second if exist ... sequence is not executed.

@kenhys
Copy link
Contributor Author

kenhys commented Jun 22, 2023

It is out of scope, I've found that post-install was always called because of a mismatch...

WixQuietExec64:  C:\Windows\SysWOW64>if not "c:\opt\fluent\bin\" == "C:\opt\fluent\bin\" ("c:\opt\fluent\bin\gem" pristine --only-executables --all ) 
WixQuietExec64:  Restoring gems to pristine condition...

@kenhys
Copy link
Contributor Author

kenhys commented Jun 22, 2023

When executing extracted bat file content to simplified msi, it will be kicked. (even though weird mojibake errror)

@kenhys kenhys force-pushed the win-migration branch 5 times, most recently from d5882e4 to 7fb0059 Compare June 23, 2023 06:35
@kenhys
Copy link
Contributor Author

kenhys commented Jun 23, 2023

with 7fb0059, WixQuietExec64 failure was fixed, but it works still unexpectdly, checking why...

@kenhys
Copy link
Contributor Author

kenhys commented Jun 23, 2023

c:\opt\td-agent was linked to c:\opt\fluent.

image

@kenhys
Copy link
Contributor Author

kenhys commented Jun 23, 2023

image

c:\opt\fluent\var\log\td-agent was linked to c:\opt\fluent\var\log\fluent.

@kenhys
Copy link
Contributor Author

kenhys commented Jul 4, 2023

msi

@kenhys kenhys marked this pull request as ready for review July 4, 2023 05:30
@daipom
Copy link
Contributor

daipom commented Jul 6, 2023

Thanks! I will review this again!

kenhys and others added 6 commits July 10, 2023 17:47
Before:

* Configuration c:\opt\td-agent\etc\td-agent\td-agent.conf
* Log files: c:\opt\td-agent

After:

* Move configuration to c:\opt\fluent\etc\fluent\td-agent.conf
* Create symbolic link to c:\opt\fluent\etc\fluent as c:\opt\fluent\var\log\fluent.
* Overwrite c:\opt\fluent\etc\fluentd.conf with td-agent.conf (when
upgrade)
* Migrate to FLUENT_PACKAGE_TOPDIR environment variable.

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
See fluent/fluentd#1138

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
After:

* Move configuration files to c:\opt\fluent\etc\fluent\td-agent.conf
* Create symbolic link to c:\opt\fluent\etc\fluent.

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
Co-authored-by: Daijiro Fukuda <fukuda@clear-code.com>
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
@daipom
Copy link
Contributor

daipom commented Jul 10, 2023

I have rebased this to apply

Copy link
Contributor

@daipom daipom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now the migration process works stably!

I have several concerns on a point other than the migration process itself.
I have commented them below.

fluent-package/msi/assets/fluentd.bat Outdated Show resolved Hide resolved
evaluation should be delayed until executing fluentd.

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
@ashie
Copy link
Member

ashie commented Jul 11, 2023

Install test seems failed since ab9df59

Installing C:\fluentd\fluent-package\msi\repositories\fluent-package-5.0.0-x64.msi 
Start-Service : Cannot find any service with service name 'fluentdwinsvc'. 
At C:\fluentd\fluent-package\msi\install-test.ps1:7 char:1
+ Start-Service fluentdwinsvc
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (fluentdwinsvc:String) [Start-Se  
   rvice], ServiceCommandException
    + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.  
   Commands.StartServiceCommand

Remove needless FLUENT_PACKAGE_TOPDIR=.

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
@kenhys
Copy link
Contributor Author

kenhys commented Jul 12, 2023

Redundant expression causes registration error.
It will be fixed via 40bc79d.

@daipom
Copy link
Contributor

daipom commented Jul 12, 2023

Thanks! I will check the behavior of the package after CI finishes.

Copy link
Contributor

@daipom daipom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

We should handle the following points in other PRs.

@daipom daipom merged commit c974a20 into fluent:master Jul 14, 2023
18 of 19 checks passed
@kenhys kenhys deleted the win-migration branch July 20, 2023 05:29
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

Successfully merging this pull request may close these issues.

3 participants